Once the select keyword comes into play, Go channels can be used in several unique ways to do many more things than those you experienced in Chapter 9, Concurrency in Go – Goroutines, Channels, and Pipelines. This section will reveal the many uses of Go channels.
It helps to remember that the zero value of the channel type is nil, and that if you send a message to a closed channel, the program will panic. However, if you try to read from a closed channel, you will get the zero value of the type of that channel. So, after closing a channel, you can no longer write to it, but you can still read from it.
In order to be able to close a channel, the channel must not be receive-only. Additionally, a nil channel always blocks, which means that trying to read or write from a nil channel will block. This property of channels can be very useful when you want...