Commit 5912869d authored by Rob Pike's avatar Rob Pike

html/template: make Must work

Fixes #2545.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5475054
parent 8c0b699c
......@@ -183,7 +183,9 @@ func (t *Template) Lookup(name string) *Template {
// Must panics if err is non-nil in the same way as template.Must.
func Must(t *Template, err error) *Template {
t.text = template.Must(t.text, err)
if err != nil {
panic(err)
}
return t
}
......
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