summaryrefslogtreecommitdiffstats
path: root/tpl/tplimpl
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2022-03-16 13:11:29 +0100
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2022-03-16 13:14:23 +0100
commit3476b5334306cf41842d3ad35b85a9577f5a6567 (patch)
tree2b557cc3b5f7eb18740fd10c19c0da8ce3be8ccf /tpl/tplimpl
parente792d27017a614d136cd4c2ff2309ccf0876b3b6 (diff)
tpl: Pull in Go 1.18 patch that fixes the "no space in {{ continue }} and {{ break }}" bug
Diffstat (limited to 'tpl/tplimpl')
-rw-r--r--tpl/tplimpl/integration_test.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/tpl/tplimpl/integration_test.go b/tpl/tplimpl/integration_test.go
index 18cebc7d1..49722c5c1 100644
--- a/tpl/tplimpl/integration_test.go
+++ b/tpl/tplimpl/integration_test.go
@@ -75,9 +75,10 @@ title: "P1"
-- layouts/partials/counter.html --
{{ if .Scratch.Get "counter" }}{{ .Scratch.Add "counter" 1 }}{{ else }}{{ .Scratch.Set "counter" 1 }}{{ end }}{{ return true }}
-- layouts/_default/single.html --
-{{/* Note no spaces in {{continue}} or {{break}}, see https://github.com/golang/go/issues/51670 */}}
continue:{{ range seq 5 }}{{ if eq . 2 }}{{continue}}{{ end }}{{ . }}{{ end }}:END:
break:{{ range seq 5 }}{{ if eq . 2 }}{{break}}{{ end }}{{ . }}{{ end }}:END:
+continue2:{{ range seq 5 }}{{ if eq . 2 }}{{ continue }}{{ end }}{{ . }}{{ end }}:END:
+break2:{{ range seq 5 }}{{ if eq . 2 }}{{ break }}{{ end }}{{ . }}{{ end }}:END:
counter1: {{ partial "counter.html" . }}/{{ .Scratch.Get "counter" }}
and1: {{ if (and false (partial "counter.html" .)) }}true{{ else }}false{{ end }}
@@ -103,6 +104,8 @@ counter2: {{ .Scratch.Get "counter" }}
b.AssertFileContent("public/p1/index.html", `
continue:1345:END:
break:1:END:
+continue2:1345:END:
+break2:1:END:
counter1: true/1
and1: false
or1: true