]> Cypherpunks repositories - gostls13.git/commitdiff
text/template: revert minor change to Name method
authorRob Pike <r@golang.org>
Sat, 9 Mar 2013 00:39:54 +0000 (16:39 -0800)
committerRob Pike <r@golang.org>
Sat, 9 Mar 2013 00:39:54 +0000 (16:39 -0800)
For  better printing, I recently changed Name to return "<unnamed>" 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

index d801c790ef0702f998149500940c856b66862f22..a2b9062ad1442006d5cbb5c2bffed945fc2c4160 100644 (file)
@@ -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 "<unnamed>"
-       }
        return t.name
 }