Changes to be committed:

modified:   pkg/obilua/lua.go
	modified:   pkg/obioptions/version.go
This commit is contained in:
Eric Coissac
2024-12-04 11:42:05 +01:00
parent 39dd3e3ce8
commit f2525d7b07
2 changed files with 10 additions and 3 deletions

View File

@ -4,6 +4,7 @@ import (
"bytes"
"fmt"
"os"
"reflect"
"git.metabarcoding.org/obitools/obitools4/obitools4/pkg/obiiter"
"git.metabarcoding.org/obitools/obitools4/obitools4/pkg/obioptions"
@ -119,11 +120,17 @@ func LuaWorker(proto *lua.FunctionProto) obiseq.SeqWorker {
case *obiseq.BioSequenceSlice:
return *val, err
default:
return nil, fmt.Errorf("worker function doesn't return the correct type %T", val)
r := reflect.TypeOf(val)
return nil, fmt.Errorf("worker function doesn't return the correct type %s", r)
}
}
return nil, fmt.Errorf("worker function doesn't return the correct type")
// If worker retuns nothing then it is considered as nil biosequence
if _, ok = lreponse.(*lua.LNilType); ok {
return nil, nil
}
return nil, fmt.Errorf("worker function doesn't return the correct type %T", lreponse)
}
return f

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 = "ad2461a"
var _Commit = "39dd3e3"
var _Version = "Release 4.3.0"
// Version returns the version of the obitools package.