Added the RegisterFunc() interface to the expression context

This commit is contained in:
2024-03-30 06:54:43 +01:00
parent 20007a5a81
commit e012afa691
4 changed files with 8 additions and 4 deletions
+1 -1
View File
@@ -33,7 +33,7 @@ func EvalStringV(source string, args []EvalArg) (result any, err error) {
for _, arg := range args {
if isFunc(arg.value) {
if f, ok := arg.value.(FuncTemplate); ok {
ctx.addFunc(arg.name, f)
ctx.RegisterFunc(arg.name, f, 0, -1)
} else {
err = fmt.Errorf("invalid function specification: %q", arg.name)
}