From 2221bc35cf5b133071feea7013b4c6509ae3b563 Mon Sep 17 00:00:00 2001 From: Dmitri Shuralyov Date: Sat, 21 Nov 2015 17:09:08 -0800 Subject: [PATCH] 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/17170 Reviewed-by: Andrew Gerrand --- src/html/template/example_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/src/html/template/example_test.go b/src/html/template/example_test.go index 40fc3ba47b..3fc982054e 100644 --- a/src/html/template/example_test.go +++ b/src/html/template/example_test.go @@ -31,6 +31,7 @@ func Example() { } } t, err := template.New("webpage").Parse(tpl) + check(err) data := struct { Title string -- 2.50.0