diff --git a/generator/generator.go b/generator/generator.go index 6d7968fe3..943c695b5 100644 --- a/generator/generator.go +++ b/generator/generator.go @@ -403,15 +403,12 @@ func (g *generator) writeTemplate(nodeIdx int, t parser.HTMLTemplate) error { if _, err = g.w.WriteIndent(indentLevel, "templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context\n"); err != nil { return err } - if _, err = g.w.WriteIndent(indentLevel, "ctxErr := ctx.Err()\n"); err != nil { - return err - } - if _, err = g.w.WriteIndent(indentLevel, "if ctxErr != nil {\n"); err != nil { + if _, err = g.w.WriteIndent(indentLevel, "if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil {\n"); err != nil { return err } { indentLevel++ - if _, err = g.w.WriteIndent(indentLevel, "return ctxErr"); err != nil { + if _, err = g.w.WriteIndent(indentLevel, "return templ_7745c5c3_CtxErr"); err != nil { return err } indentLevel--