Standard library / html/template

html/template.ErrAmbigContext

An action lies in an ambiguous URL context. Expected stdout: 'true\n'.

Formal Syntax & Structure

go syntaxgo
const ErrAmbigContext ErrorCode

Working Example

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