summaryrefslogtreecommitdiff
path: root/src/pkg/text/template/template.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/pkg/text/template/template.go')
-rw-r--r--src/pkg/text/template/template.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/pkg/text/template/template.go b/src/pkg/text/template/template.go
index a2b9062ad..249d0cbfb 100644
--- a/src/pkg/text/template/template.go
+++ b/src/pkg/text/template/template.go
@@ -105,7 +105,7 @@ func (t *Template) copy(c *common) *Template {
// AddParseTree creates a new template with the name and parse tree
// and associates it with t.
func (t *Template) AddParseTree(name string, tree *parse.Tree) (*Template, error) {
- if t.tmpl[name] != nil {
+ if t.common != nil && t.tmpl[name] != nil {
return nil, fmt.Errorf("template: redefinition of template %q", name)
}
nt := t.New(name)