mirror of
https://github.com/metabarcoding/obitools4.git
synced 2025-06-29 16:20:46 +00:00
add min and max to the obitools expression language
This commit is contained in:
@ -135,6 +135,12 @@ var OBILang = gval.NewLanguage(
|
||||
length := obiutils.Len(args[0])
|
||||
return (float64)(length), nil
|
||||
}),
|
||||
gval.Function("min", func(args ...interface{}) (interface{}, error) {
|
||||
return obiutils.Min(args[0])
|
||||
}),
|
||||
gval.Function("max", func(args ...interface{}) (interface{}, error) {
|
||||
return obiutils.Max(args[0])
|
||||
}),
|
||||
gval.Function("contains", func(args ...interface{}) (interface{}, error) {
|
||||
if obiutils.IsAMap(args[0]) {
|
||||
val := reflect.ValueOf(args[0]).MapIndex(reflect.ValueOf(args[1]))
|
||||
|
Reference in New Issue
Block a user