Imagine a code pattern like the following:
var a chan T = make(chan T)
var b chan Q = make(chan Q)
//consumer goroutine
for {
select {
case <-a:
//...
case <-b:
//...
}
}
//producer goroutine
...
a <- x
b <- y
...
Is it guaranteed that we can always retrieve x from case: <-a BEFORE y from case :<-b provided that there is only one producer?