I am using select statement to dispatch work coming from multiple 
goroutines, the variables used to consume the channel are allocated 
manually as I am recycling those


for {
 a := getA()
 b := getB()
 select {
 case a = <-chan1:
  go doSomething(&a)
 case b = <-chan2:
  go doSomething2(&b)
 }
}


This obviously does not work while listening on more than one channel, as I 
wasting a get() call for the other type, is there any way to do some 
"prework" before consuming the channel

-- 
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 protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to