]> Cypherpunks repositories - gostls13.git/commitdiff
text/template: rename the method Template.Template to Template.Lookup
authorRob Pike <r@golang.org>
Sat, 26 Nov 2011 16:32:55 +0000 (08:32 -0800)
committerRob Pike <r@golang.org>
Sat, 26 Nov 2011 16:32:55 +0000 (08:32 -0800)
Calling it Template makes it clumsy to embed the type, which html/template
depends on.

R=golang-dev, gri
CC=golang-dev
https://golang.org/cl/5432079

src/pkg/text/template/exec_test.go
src/pkg/text/template/template.go

index 1cfa0d18423be53de5fd324b544c5be731b49d37..cf3c41572816f578b98a539db57b85e8bc975d4e 100644 (file)
@@ -677,7 +677,7 @@ func TestTree(t *testing.T) {
        }
        const expect = "[1[2[3[4]][5[6]]][7[8[9]][10[11]]]]"
        // First by looking up the template.
-       err = tmpl.Template("tree").Execute(&b, tree)
+       err = tmpl.Lookup("tree").Execute(&b, tree)
        if err != nil {
                t.Fatal("exec error:", err)
        }
index 27b870715142aaab6ca242b198fbb2d058472580..aa559fa8afcbf831c239f556bf2f9a7207be6eb3 100644 (file)
@@ -136,9 +136,9 @@ func (t *Template) Funcs(funcMap FuncMap) *Template {
        return t
 }
 
-// Template returns the template with the given name that is associated with t,
+// Lookup returns the template with the given name that is associated with t,
 // or nil if there is no such template.
-func (t *Template) Template(name string) *Template {
+func (t *Template) Lookup(name string) *Template {
        return t.tmpl[name]
 }