exp/template: A template can be in one set only.
This simplifies the API and makes it easier to make the template
invocation statically secure, at the cost of some minor flexibility.
R=golang-dev, dsymonds, r
CC=golang-dev
https://golang.org/cl/4794045
diff --git a/src/pkg/exp/template/exec_test.go b/src/pkg/exp/template/exec_test.go
index eb5ab71..36eaabe 100644
--- a/src/pkg/exp/template/exec_test.go
+++ b/src/pkg/exp/template/exec_test.go
@@ -358,13 +358,13 @@
funcs := FuncMap{"zeroArgs": zeroArgs, "oneArg": oneArg, "typeOf": typeOf}
for _, test := range execTests {
tmpl := New(test.name).Funcs(funcs)
- err := tmpl.Parse(test.input)
+ err := tmpl.ParseInSet(test.input, set)
if err != nil {
t.Errorf("%s: parse error: %s", test.name, err)
continue
}
b.Reset()
- err = tmpl.ExecuteInSet(b, test.data, set)
+ err = tmpl.Execute(b, test.data)
switch {
case !test.ok && err == nil:
t.Errorf("%s: expected error; got none", test.name)