From 0406c63ea38520adf040f3f72ea3d8008dd53480 Mon Sep 17 00:00:00 2001 From: Rob Pike Date: Fri, 8 Mar 2013 16:39:54 -0800 Subject: [PATCH] text/template: revert minor change to Name method For better printing, I recently changed Name to return "" for templates with empty names, but this causes trouble for the many packages that used "" as the template name, so restore the old behavior. It's usually printed as a quoted string anyway, so it should be fine. R=golang-dev, dsymonds CC=golang-dev https://golang.org/cl/7577044 --- src/pkg/text/template/template.go | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/pkg/text/template/template.go b/src/pkg/text/template/template.go index d801c790ef0..a2b9062ad14 100644 --- a/src/pkg/text/template/template.go +++ b/src/pkg/text/template/template.go @@ -40,9 +40,6 @@ func New(name string) *Template { // Name returns the name of the template. func (t *Template) Name() string { - if t.name == "" { - return "" - } return t.name }