3 ms·
I may not understand what you're looking for, but what's wrong with this: topLoop: for _, batch := range list { for _, item := range batch {
by jppittma 3y ago
I may not understand what you're looking for, but what's wrong with this:
topLoop:
for _, batch := range list {
for _, item := range batch {
if condition(item) {
break topLoop
}
}
}
The language also supports a limited goto. Combined with select and context, I've never seen a situation I felt I couldn't adequately describe.