The magic behind contexts is that they use a channel but without sending any data over it. Instead, *closing* the channel is a signal to terminate.
This allows you to have multiple goroutines listening on the channel, and they will *all* receive the termination signal, as a broadcast. (It wouldn't work if you sent an item of data on the channel: if you did that, then only one of the receivers would get it) -- 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. To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/ebd00f1f-d384-457f-8ec8-bc09968d64f8%40googlegroups.com.