]> Cypherpunks repositories - gostls13.git/commitdiff
html/template: replace obsolete reference to template.Set
authorRob Pike <r@golang.org>
Sat, 18 Feb 2012 05:02:51 +0000 (16:02 +1100)
committerRob Pike <r@golang.org>
Sat, 18 Feb 2012 05:02:51 +0000 (16:02 +1100)
Fixes #3053.

R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/5656094

src/pkg/html/template/doc.go

index 6fe507abea4c8ddca94ed0d3c59746602b39768e..23611bcfc5f85add2d199e6380c7af40cf2f80ee 100644 (file)
@@ -17,11 +17,11 @@ Introduction
 This package wraps package text/template so you can share its template API
 to parse and execute HTML templates safely.
 
-  set, err := new(template.Set).Parse(...)
+  tmpl, err := template.New("name").Parse(...)
   // Error checking elided
-  err = set.Execute(out, "Foo", data)
+  err = tmpl.Execute(out, "Foo", data)
 
-If successful, set will now be injection-safe. Otherwise, err is an error
+If successful, tmpl will now be injection-safe. Otherwise, err is an error
 defined in the docs for ErrorCode.
 
 HTML templates treat data values as plain text which should be encoded so they