func () {
ch <- 5
close(ch)
}// Check if a channels is closed
val, is_closed := <- chIf the channel is closed, any more receives will provided with zeros
Closing a channel is particularly useful, when ranging over it on a loop.
func () {
ch <- 5
close(ch)
}// Check if a channels is closed
val, is_closed := <- chIf the channel is closed, any more receives will provided with zeros
Closing a channel is particularly useful, when ranging over it on a loop.