Skip to content

Commit 7540b1e

Browse files
author
1911860538
committed
text/template: rename builtinFuncsOnce to builtinFuncs
1 parent 558c2a9 commit 7540b1e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/text/template/funcs.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,8 @@ func builtins() FuncMap {
6262
}
6363
}
6464

65-
// builtinFuncsOnce lazily computes & caches the builtinFuncs map.
66-
var builtinFuncsOnce = sync.OnceValue(func() map[string]reflect.Value {
65+
// builtinFuncs lazily computes & caches the builtinFuncs map.
66+
var builtinFuncs = sync.OnceValue(func() map[string]reflect.Value {
6767
funcMap := builtins()
6868
m := make(map[string]reflect.Value, len(funcMap))
6969
addValueFuncs(m, funcMap)
@@ -136,7 +136,7 @@ func findFunction(name string, tmpl *Template) (v reflect.Value, isBuiltin, ok b
136136
return fn, false, true
137137
}
138138
}
139-
if fn := builtinFuncsOnce()[name]; fn.IsValid() {
139+
if fn := builtinFuncs()[name]; fn.IsValid() {
140140
return fn, true, true
141141
}
142142
return reflect.Value{}, false, false

0 commit comments

Comments
 (0)