aboutsummaryrefslogtreecommitdiff
path: root/src/pkg/text/template/exec.go
diff options
context:
space:
mode:
authorRob Pike <r@golang.org>2014-04-15 08:48:40 -0700
committerRob Pike <r@golang.org>2014-04-15 08:48:40 -0700
commitaeb37527d3795b9677295bb21c0bbb3af18d6f31 (patch)
tree651073268fc919a65aea74f6ea380601e3efd7af /src/pkg/text/template/exec.go
parent55e0f36fb46cd3c5b54c4fb0d8444135c3dff0ac (diff)
downloadgo-aeb37527d3795b9677295bb21c0bbb3af18d6f31.tar.xz
text/template: say more often that templates are safe for parallel execution
It was said already but apparently not enough times. Fixes #6985. LGTM=crawshaw R=golang-codereviews, crawshaw CC=golang-codereviews https://golang.org/cl/86300043
Diffstat (limited to 'src/pkg/text/template/exec.go')
-rw-r--r--src/pkg/text/template/exec.go2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/pkg/text/template/exec.go b/src/pkg/text/template/exec.go
index 6de37a1996..505509a085 100644
--- a/src/pkg/text/template/exec.go
+++ b/src/pkg/text/template/exec.go
@@ -108,6 +108,7 @@ func errRecover(errp *error) {
// ExecuteTemplate applies the template associated with t that has the given name
// to the specified data object and writes the output to wr.
+// A template may be executed safely in parallel.
func (t *Template) ExecuteTemplate(wr io.Writer, name string, data interface{}) error {
tmpl := t.tmpl[name]
if tmpl == nil {
@@ -118,6 +119,7 @@ func (t *Template) ExecuteTemplate(wr io.Writer, name string, data interface{})
// Execute applies a parsed template to the specified data object,
// and writes the output to wr.
+// A template may be executed safely in parallel.
func (t *Template) Execute(wr io.Writer, data interface{}) (err error) {
defer errRecover(&err)
value := reflect.ValueOf(data)