The Go spec says:
A “break” statement terminates execution of the innermost “for”,
“switch”, or “select” statement within the same function.
In your example you’re just breaking out of the select statement. If you replace break
with a return
statement you will see that it’s working.