mirror of
https://github.com/golang/go
synced 2024-11-21 20:54:45 -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.
|
||||
func Must(t *Template, err error) *Template {
|
||||
t.text = template.Must(t.text, err)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return t
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user