Standard library / html/template

html/template.ErrEndContext

The executed template ends in an unfinished context. Expected stdout: 'true\n'.

Formal Syntax & Structure

go syntaxgo
const ErrEndContext ErrorCode

Working Example

Example Snippetgo
package main
import (  "errors"  "fmt"  "html/template"  "io")
func main() {  t := template.Must(template.New("x").Parse("<a href=\"{{.}}"))  var e *template.Error  err := t.Execute(io.Discard, nil)  fmt.Println(errors.As(err, &e) && e.ErrorCode == template.ErrEndContext)}
Go Reference