-
-
Notifications
You must be signed in to change notification settings - Fork 73
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Beginning of rewrite. Can parse header and LOCUS.
- Loading branch information
Showing
7 changed files
with
729 additions
and
2,000 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package genbank | ||
|
||
import "fmt" | ||
|
||
// A GenbankSyntaxError denotes a sytntax error in | ||
// a Genbank flatfile. | ||
type GenbankSyntaxError struct { | ||
Line uint | ||
Context string | ||
Msg string | ||
InnerErr error | ||
} | ||
|
||
// Error returns a human-readable error message. | ||
func (gse GenbankSyntaxError) Error() string { | ||
msg := gse.Msg | ||
if gse.InnerErr != nil { | ||
msg = fmt.Errorf("%v: %w", msg, gse.InnerErr).Error() | ||
} | ||
|
||
return fmt.Sprintf("syntax error at line %v: %v\n%v\t%v", gse.Line, msg, gse.Line, gse.Context) | ||
} | ||
|
||
// Unwrap returns any errors underlying the syntax error, if applicable. | ||
func (gse GenbankSyntaxError) Unwrap() error { | ||
return gse.InnerErr | ||
} |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.