Re:Coroutines for Go
by bouk on Monday July 17, 2023 @05:03PM
(#36764047)
The first doesn't do control flow
[ Parent
| on HN ]
Depends how getNext is defined.
The only way to do control flow in getNext, consistent with how you partially defined it, is to panic. That means there is some important code wrapping the whole loop body that you left out.