DEV Community

loading...

Discussion on: A Simple Slack Bot in Go - The Bot

Collapse
vicentdev profile image
Vicent

Why did you use label "loop" instead of boolean condition for breaking the loop? I'm pretty noob with golang and I don't know a lot of about performance with this language -.-'

Collapse
shindakun profile image
Steve Layton Author

In this case, it's so we can break all the way out of the for/select/switch blocks all in one go and it keeps the code a tad more readable I think. Bill Kennedy has a good post about this over on Ardan Labs.

Forem Open with the Forem app