I proudly use labels with go loops


Every time I mention this to other gophers, I got ugly looks. For whatever reason, labels are shunned in go land.

But I just think that cleanly naming the loop you are breaking/continuing is *always* more readable? See these two examples


In my opinion, the second example is strictly always more readable.

And sure, the purists might say "well just rewrite to another function and use return there". Well, sometimes, that is just not worth the effort.

Eh, just my 2 cents.

github | gemini