-
Notifications
You must be signed in to change notification settings - Fork 17.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
text/template: break/continue require no whitespace around them #51670
Comments
Change https://go.dev/cl/392615 mentions this issue: |
Shouldn’t this ticket be open until its merged? Quick test shows it’s not working yet: |
It is merged into tip |
How about a backport to the next point release? |
@gopherbot Please open a backport to 1.18. These new text/template features are new in the 1.18 release, but they have a oddity in that don't permit whitespace. It's probably worth fixing that in 1.18 so that they people don't have to slightly contort their new code until 1.19 comes out. |
Backport issue(s) opened: #52878 (for 1.18), #52879 (for 1.19). Remember to create the cherry-pick CL(s) as soon as the patch is submitted to master, according to https://go.dev/wiki/MinorReleases. |
Change https://go.dev/cl/406074 mentions this issue: |
…ue or break Trivial fix: We must skip space after either of these keywords before we expect a closing delimiter. Also delete the stutter-generating extra 'in' in the error message. (See what I did there?) For #51670 Fixes #52878 Change-Id: If5415632c36eaac6699bdc0aa6ce18be956c9b53 Reviewed-on: https://go-review.googlesource.com/c/go/+/392615 Reviewed-by: Ian Lance Taylor <[email protected]> Run-TryBot: Ian Lance Taylor <[email protected]> Reviewed-by: Daniel Martí <[email protected]> Trust: Daniel Martí <[email protected]> TryBot-Result: Gopher Robot <[email protected]> (cherry picked from commit 41a82aa) Reviewed-on: https://go-review.googlesource.com/c/go/+/406074 Reviewed-by: Alex Rakoczy <[email protected]> Auto-Submit: Ian Lance Taylor <[email protected]> Run-TryBot: Ian Lance Taylor <[email protected]> Reviewed-by: Ian Lance Taylor <[email protected]>
Related: golang/go#51670 Signed-off-by: Giau. Tran Minh <[email protected]>
Related: golang/go#51670 Signed-off-by: Giau. Tran Minh <[email protected]>
Related: golang/go#51670 Signed-off-by: Giau. Tran Minh <[email protected]> Signed-off-by: Giau. Tran Minh <[email protected]>
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
break
/continue
in templates require no whitespace around them unlike other keywords.https://go.dev/play/p/pbmCi6ystSG?v=gotip
What did you expect to see?
{{ range . }}{{ continue }}{{ end }}
compiles fine.What did you see instead?
The text was updated successfully, but these errors were encountered: