Unbuffered and Buffered Channels
Channels created with simple make
is called as unbuffered channel.
But make
could use a second parameter which indicates the channel's capacity. If this capacity is non-zero, make
will created a buffered channel.
ch = make(chan int) // unbuffered channel
ch = make(chan int, 0) // unbuffered channel
ch = make(chan int, 3) // buffered channel with capacity 3