]> Cypherpunks repositories - gostls13.git/commitdiff
doc: update Effective Go for template API change.
authorNigel Tao <nigeltao@golang.org>
Tue, 4 Jan 2011 04:52:03 +0000 (15:52 +1100)
committerNigel Tao <nigeltao@golang.org>
Tue, 4 Jan 2011 04:52:03 +0000 (15:52 +1100)
The original change 3378041 was submitted in December 2010:
template: change the signature of formatters for future development.

R=adg
CC=golang-dev
https://golang.org/cl/3862041

doc/effective_go.html

index ab21edfbba712ffa23cfa4884d09043ced20a80b..b70d60a925da9e4ffd252801524a1749f74da5bb 100644 (file)
@@ -2857,8 +2857,8 @@ func QR(w http.ResponseWriter, req *http.Request) {
     templ.Execute(req.FormValue("s"), w)
 }
 
-func UrlHtmlFormatter(w io.Writer, v interface{}, fmt string) {
-    template.HTMLEscape(w, []byte(http.URLEscape(v.(string))))
+func UrlHtmlFormatter(w io.Writer, fmt string, v ...interface{}) {
+    template.HTMLEscape(w, []byte(http.URLEscape(v[0].(string))))
 }