Indeed everything works according to the specs. That is what is being questioned (the specs). > > This behavior for case clause of select statements have different semantics than case clause of switch statement.
While the latter gets evaluated lazily (short circuited), the former gets evaluated eagerly - inconsistent semantics for looking-the-same syntax. Here all the values will get prepared first, whether or not they are going to be used. And only after this step, the select statement would check if a channel is nil or not. While it should be other way around. First the select statement should check if a participant channel is nil. And only when a channel is not nil, the payload should get evaluated. This semantic works in reverse. -- 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.