One of the best things about learning Go has been that almost every time I ask "why doesn't it do <x> the way I expect?", the answer has been very instructive.In that spirit, why aren't channel inputs in non-selected select cases evaluated lazily?
See:It seems to me that, in the second example, because nilChannel isn't selected in the case statement, there is no need to evaluate the proposed send value. The sample code is silly, but this would e.g. obviate the need for the variable first in http://talks.golang.org/2013/advconc.slide#30.Cheers,Josh
--
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 golang-nuts...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.