1
0
mirror of https://github.com/golang/go synced 2024-11-21 21:54:40 -07:00

html/template: replace obsolete reference to template.Set

Fixes #3053.

R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/5656094
This commit is contained in:
Rob Pike 2012-02-18 16:02:51 +11:00
parent 292bd04a43
commit 701fb580bd

View 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