-
Notifications
You must be signed in to change notification settings - Fork 17.6k
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: add break and continue support #20531
Comments
It does seem a little reasonable. I wouldn't want labels (or goto), though. Thoughts, @robpike? |
It does seem reasonable but low priority. |
CLs welcome for Go 1.10. Thanks. |
Change https://golang.org/cl/66410 mentions this issue: |
Change https://golang.org/cl/92155 mentions this issue: |
The patch was rolled back, so reopening. |
This seems like an easy way to create goroutine leaks that weren't possible before since range can iterate over a channel. |
@jimmyfrasche There are zillions of ways to create goroutine leaks. Adding one more doesn't seem to be that much of a change to the world. |
@robpike Certainly true. I originally thought that this is different as, if the templates are user provided, it's a way for the provided template to cause the leak, but then I realized that the same goroutine leak could be caused by the template simply choosing to not range over the channel at all. Either way, it's up to the program running the template to ensure all chans are drained after execution. |
Change https://golang.org/cl/321491 mentions this issue: |
Change https://golang.org/cl/373915 mentions this issue: |
For #20531 For #47694 Change-Id: Iaefaa0a8982eabf59cd6a53120c8af9124d60d1a Reviewed-on: https://go-review.googlesource.com/c/go/+/373915 Trust: Ian Lance Taylor <iant@golang.org> Reviewed-by: Emmanuel Odeke <emmanuel@orijtech.com>
This is a repost of #20523 with, hopefully, a more clear description.
Go templates currently do not support the
break
nor thecontinue
keyword -- which surprises people trying a construct similar to the one below./cc @igramnet
The text was updated successfully, but these errors were encountered: