Update range-over-channels.go

This commit is contained in:
QGerrit 2022-10-19 11:53:10 -06:00 committed by GitHub
parent 4f668ee955
commit a12821076e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -13,6 +13,7 @@ func main() {
queue := make(chan string, 2)
queue <- "one"
queue <- "two"
// queue <- "three" // would deadlock, since the channel buffer is full
close(queue)
// This `range` iterates over each element as it's