patch a bug in Taxid parsing

This commit is contained in:
Eric Coissac
2024-12-19 13:54:23 +01:00
parent 795df34d1a
commit abfa8f357a
2 changed files with 3 additions and 2 deletions

View File

@ -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.

View File

@ -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)
}