diff options
Diffstat (limited to 'libgo/go/text/template/funcs.go')
-rw-r--r-- | libgo/go/text/template/funcs.go | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/libgo/go/text/template/funcs.go b/libgo/go/text/template/funcs.go index 39ee5ed68fb..ccd0dfc80d8 100644 --- a/libgo/go/text/template/funcs.go +++ b/libgo/go/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 } @@ -590,7 +592,7 @@ func evalArgs(args []interface{}) string { a, ok := printableValue(reflect.ValueOf(arg)) if ok { args[i] = a - } // else left fmt do its thing + } // else let fmt do its thing } s = fmt.Sprint(args...) } |