Channels are mechanisms that allow the sending and receiving of values. Channels are often used alongside goroutines in order to deliver transfer objects concurrently across goroutines. There are two main classifications of channels in Go: unbuffered channels and buffered channels.
Introducing channels
Channel internals
Channels are invoked using the make() Golang built-in, where an hchan struct is created. The hchan struct contains a count of the data in the queue, the size of the queue, an array pointer for the buffer, send and receive indices and waiters, and a mutex lock. The following code block illustrates this:
type hchan struct {
qcount uint // total data in the queue
dataqsiz uint // size...