mirror of
https://github.com/metabarcoding/obitools4.git
synced 2026-11-10 01:24:41 +00:00
add min and max to the obitools expression language
This commit is contained in:
1 parent
f1b9ac4a13
commit
f9324dd8f4
4 files changed
+210
-12
No files matched your search
@@ -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