Unbuffered — synchronous. Buffered — asynchronous up to capacity.
Unbuffered channel:
1ch := make(chan int)23go func() {4 ch <- 1 // Blocks until received5}()67value := <-ch // Unblocks sender
Buffered channel:
1ch := make(chan int, 3)23ch <- 1 // Doesn't block (buffer not full)4ch <- 2 // Doesn't block5ch <- 3 // Doesn't block6ch <- 4 // Blocks until space available
When to use: