Go Channel Patterns
Golang Channel Patterns Golang channel allows us to transfer data structure between go-routine boundaries. It could be zero byte data struct{}{}, served as signaling purpose. In this use case, the channel is semantically a signaling, by which, one go-routine can send a signal to another go-routine, as a notification or an event.
Signaling without data serves the main purpose of cancellation. It allows one go-routine to signal another go-routine to cancel the channel.
Posted by Henry Du on Tuesday, October 27, 2020