mirror of
https://github.com/metabarcoding/obitools4.git
synced 2025-06-29 16:20:46 +00:00
patch a bug in Taxid parsing
This commit is contained in:
@ -7,7 +7,7 @@ import (
|
||||
// TODO: The version number is extracted from git. This induces that the version
|
||||
// corresponds to the last commit, and not the one when the file will be
|
||||
// commited
|
||||
var _Commit = "f41a6fb"
|
||||
var _Commit = "795df34"
|
||||
var _Version = "Release 4.2.0"
|
||||
|
||||
// Version returns the version of the obitools package.
|
||||
|
@ -21,7 +21,7 @@ type TaxidFactory struct {
|
||||
func NewTaxidFactory(code string, alphabet obiutils.AsciiSet) *TaxidFactory {
|
||||
return &TaxidFactory{
|
||||
inner: NewInnerString(),
|
||||
code: code + ":",
|
||||
code: code,
|
||||
alphabet: alphabet,
|
||||
}
|
||||
// Initialize and return a new TaxidFactory.
|
||||
@ -35,6 +35,7 @@ func (f *TaxidFactory) FromString(taxid string) (Taxid, error) {
|
||||
if len(part2) == 0 {
|
||||
taxid = part1
|
||||
} else {
|
||||
//log.Warnf("TaxidFactory.FromString: taxid %s -> -%s- -%s- ", taxid, part1, part2)
|
||||
if part1 != f.code {
|
||||
return nil, fmt.Errorf("taxid %s string does not start with taxonomy code %s", taxid, f.code)
|
||||
}
|
||||
|
Reference in New Issue
Block a user