Closed lorypelli closed 3 hours ago
Related Issues and Documentation
(Emoji vote if this was helpful or unhelpful; more detailed feedback welcome in this discussion.)
Duplicate of #55868
Duplicate of #55868
that issue was closed and I don't like using break
keyword
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
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