This is not a good idea (and is wrong since it does not check the ok value of the receive operation). As was pointed out previously, this is only true in the instant that the select is occurring.
On Mon, 2017-11-06 at 18:39 -0800, sheepbao wrote: > func isClose() bool { > select { > case <-closeChan: > return true > default: > return false > } > } -- 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.