When reading from multiple channels in a select statement, if multiple are
ready then one is pseudo-randomly chosen. I've never seen it used like
this, where a literal is put into a channel, but it seems to works the same
way in my testing. Of course, it must be a buffered channel. I got this
working from your sample: https://play.golang.org/p/GI67itVKAE
I don't believe it's correct that there are separate goroutines in the
select statement, but someone more familiar with language internals would
have to explain why or why not.
In any case, at least we both understand the behavior now. Thanks for
bringing this use-case to my attention.
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to email@example.com.
For more options, visit https://groups.google.com/d/optout.