You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Create an empty foo.tmpl file. Execute this code:
----------
package main
import (
"html/template"
"log"
"os"
)
const (
tmplFile = "foo.tmpl"
)
func main() {
page := template.Must(template.New("page").ParseFiles(tmplFile))
data := "bla"
if err := page.ExecuteTemplate(os.Stdout, "page", data); err != nil {
log.Print("Failed:", err)
}
}
----------
The "page" there is a mistake, but the html/template package panics
(html/template internal error: template escaping out of sync) at template.go:68. If you
replace "page" with "foobarbaz" (or anything not naming a template
at all), you get a nil pointer panic at template.go:57.
The text was updated successfully, but these errors were encountered:
The text was updated successfully, but these errors were encountered: