-
Notifications
You must be signed in to change notification settings - Fork 18.1k
proposal: add do...for
loop
#70064
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
Labels
LanguageChange
Suggested changes to the Go language
LanguageChangeReview
Discussed by language change review committee
Proposal
Milestone
Comments
Duplicate of #55868 |
that issue was closed and I don't like using |
and that would also be an infinite loop which is not that cool |
Duplicate of #34896 |
in either case adding more syntax sugar isn't really the solution |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
LanguageChange
Suggested changes to the Go language
LanguageChangeReview
Discussed by language change review committee
Proposal
Uh oh!
There was an error while loading. Please reload this page.
Go Programming Experience
Intermediate
Other Languages Experience
JS, TS, Python, C, Java, Kotlin
Related Idea
Has this idea, or one like it, been proposed before?
No, it would be good to make a loop executed at least one time without duplicating code...
Does this affect error handling?
No
Is this about generics?
No
Proposal
sintax like this maybe:
i := 0
do {
i++
println(i)
} for (i < 5)
Language Spec Changes
No response
Informal Change
No response
Is this change backward compatible?
There is an entire new keyword and loop body is in a different place, I don't think so...
Orthogonality: How does this change interact or overlap with existing features?
No response
Would this change make Go easier or harder to learn, and why?
No response
Cost Description
No response
Changes to Go ToolChain
No response
Performance Costs
No response
Prototype
No response
The text was updated successfully, but these errors were encountered: