mirror of
https://github.com/golang/go
synced 2024-11-22 03:24:41 -07:00
html/template: make Must work
Fixes #2545. R=golang-dev, rsc CC=golang-dev https://golang.org/cl/5475054
This commit is contained in:
parent
8c0b699ca4
commit
5912869d61
@ -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.
|
// Must panics if err is non-nil in the same way as template.Must.
|
||||||
func Must(t *Template, err error) *Template {
|
func Must(t *Template, err error) *Template {
|
||||||
t.text = template.Must(t.text, err)
|
if err != nil {
|
||||||
|
panic(err)
|
||||||
|
}
|
||||||
return t
|
return t
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user