I get your point now, but I would not say it is common sense. When using a channel, what matters is what to send to the data, not what the channel is. If `case` evaluation behaves different depending on whether chan is nil, it is a big surprise and may raise many bugs.
It is a pattern in go that a function recieve a channel as a param. In that case, the function will have no idea if it is recieving a channel (and it should not care that) - that means the func will have no idea if the func will be evaluated or not in your common sense. That seem pretty bad. https://play.golang.org/p/znlLnuT7_lQ The point is, in a switch statement, it is not only about if it is block or not, it is also about making a move: send or recieve a value. dc0d於 2017年12月31日星期日 UTC+8下午6時55分39秒寫道: > > Please read the first message in this thread. The first() function was > *expected* to be ignored as in common sense, yet it gets evaluated. > > I am not wrong (or right), only making a point (maybe the point seems > pointless) and I have read the specs. I am saying that this behavior was > *unexpected*. > -- 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+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.