How to know a buffered channel is full
You can use the select statement with a default. In case it is not possible to do any of the cases, like sending to a full channel, the statement will do the default: package main import “fmt” func main() { ch := make(chan int, 1) // Fill it up ch <- 1 select { case … Read more