Hi, I think your answer can be found in this section: https://golang.org/ref/spec#SendStmt
"Both the channel and the *value expression are evaluated* before communication begins" cheers, silviu On Sunday, 31 December 2017 01:44:31 UTC-5, dc0d wrote: > > Assume there is this select statement: > > for { > select { > // ... > // ... > > case rcvd <- first(): > } > } > > > The rcvd channel will be set to nil or a chan value, by it's own case or > other cases. > > If the rcvd channel is nil, that case should have no effect. But even > when rcvd channel is nil, the first() function will be called. > > I did not expect that. Why is that so? > -- 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.