Commit 2221bc35 authored by Dmitri Shuralyov's avatar Dmitri Shuralyov Committed by Andrew Gerrand

html/template: Add missing error check to package example.

This appears to be an unintended omission. The check func is declared
just above, and the err value from template.Parse is captured rather
than discarded via blank identifier. All following calls that similarly
return err are checked, so it can't be that this example elides error
checking for brevity. Finally, if you look at Example_autoescaping,
it does check err from template.Parse and its code is very similar.

Change-Id: I076e1846302d5f2cdb1d027ed85ca0db85e33ace
Reviewed-on: https://go-review.googlesource.com/17170Reviewed-by: 's avatarAndrew Gerrand <adg@golang.org>
parent 54bd5a71
......@@ -31,6 +31,7 @@ func Example() {
}
}
t, err := template.New("webpage").Parse(tpl)
check(err)
data := struct {
Title string
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment