1
0
mirror of https://github.com/golang/go synced 2024-11-26 14:46:47 -07:00

text/template: revert minor change to Name method

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
This commit is contained in:
Rob Pike 2013-03-08 16:39:54 -08:00
parent 1b8f51c917
commit 0406c63ea3

View File

@ -40,9 +40,6 @@ func New(name string) *Template {
// Name returns the name of the template. // Name returns the name of the template.
func (t *Template) Name() string { func (t *Template) Name() string {
if t.name == "" {
return "<unnamed>"
}
return t.name return t.name
} }