diff --git a/codegen/templates/templates.go b/codegen/templates/templates.go index 115ef7872f6..f2c367cb3b4 100644 --- a/codegen/templates/templates.go +++ b/codegen/templates/templates.go @@ -206,6 +206,7 @@ func Funcs() template.FuncMap { "call": Call, "prefixLines": prefixLines, "notNil": notNil, + "strSplit": StrSplit, "reserveImport": CurrentImports.Reserve, "lookupImport": CurrentImports.Lookup, "go": ToGo, @@ -581,6 +582,10 @@ func notNil(field string, data any) bool { return val.IsValid() && !val.IsNil() } +func StrSplit(s, sep string) []string { + return strings.Split(s, sep) +} + func Dump(val any) string { switch val := val.(type) { case int: