aboutsummaryrefslogtreecommitdiff
path: root/src/text/template/funcs.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/text/template/funcs.go')
-rw-r--r--src/text/template/funcs.go2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/text/template/funcs.go b/src/text/template/funcs.go
index cdd187bda2..ccd0dfc80d 100644
--- a/src/text/template/funcs.go
+++ b/src/text/template/funcs.go
@@ -92,6 +92,8 @@ func goodFunc(typ reflect.Type) bool {
// findFunction looks for a function in the template, and global map.
func findFunction(name string, tmpl *Template) (reflect.Value, bool) {
if tmpl != nil && tmpl.common != nil {
+ tmpl.muFuncs.RLock()
+ defer tmpl.muFuncs.RUnlock()
if fn := tmpl.execFuncs[name]; fn.IsValid() {
return fn, true
}