Standard library / html/template

html/template.ErrRangeLoopReentry

Documented code for incompatible range loop re-entry contexts. In Go 1.23.2 the reproduced loop error instead carries ErrBranchEnd; see the batch diagnostic evidence. This example checks the typed code, not a reproduction of the failure. Expected stdout: 'true\n'.

Formal Syntax & Structure

go syntaxgo
const ErrRangeLoopReentry ErrorCode

Working Example

Example Snippetgo
package main
import (  "fmt"  "html/template")
func main() {  var code template.ErrorCode = template.ErrRangeLoopReentry  fmt.Println(code == template.ErrRangeLoopReentry)}
Go Reference