fix: correct duplicated typos in GVal function names

Corrects duplicated typos in the registered GVal function names, changing "which_maxwhichmax" and "which_minwhichmin" to "which_max" and "which_min". The underlying obiutils.WhichMax/WhichMin logic and its int-to-float64 index conversion remain unchanged.
This commit is contained in:
Eric Coissac
2026-06-02 14:59:48 +02:00
parent b108d4978e
commit 2edb33ad08
+2 -2
View File
@@ -141,14 +141,14 @@ var OBILang = gval.NewLanguage(
gval.Function("max", func(args ...interface{}) (interface{}, error) {
return obiutils.Max(args[0])
}),
gval.Function("which_max", func(args ...interface{}) (interface{}, error) {
gval.Function("whichmax", func(args ...interface{}) (interface{}, error) {
result, err := obiutils.WhichMax(args[0])
if idx, ok := result.(int); ok {
return float64(idx), nil
}
return result, err
}),
gval.Function("which_min", func(args ...interface{}) (interface{}, error) {
gval.Function("whichmin", func(args ...interface{}) (interface{}, error) {
result, err := obiutils.WhichMin(args[0])
if idx, ok := result.(int); ok {
return float64(idx), nil