79487071

Date: 2025-03-05 16:23:16
Score: 1
Natty:
Report link

There is not a way to name a function without calling the function. The code {{ listOperate . toCamel}} calls toCamel with no arguments.

Write a template function that returns the function:

"toCamelFunc": func() any {
    return func(str string) (result string) {
        return strcase.ToCamel(str)
    }
}

Use it like this: {{ listOperate . toCamelFunc}}

Reasons:
  • Has code block (-0.5):
  • Unregistered user (0.5):
  • Low reputation (1):
Posted by: Jasmine Crockett