Update range-over-channels.go
This commit is contained in:
parent
4f668ee955
commit
a12821076e
@ -13,6 +13,7 @@ func main() {
|
|||||||
queue := make(chan string, 2)
|
queue := make(chan string, 2)
|
||||||
queue <- "one"
|
queue <- "one"
|
||||||
queue <- "two"
|
queue <- "two"
|
||||||
|
// queue <- "three" // would deadlock, since the channel buffer is full
|
||||||
close(queue)
|
close(queue)
|
||||||
|
|
||||||
// This `range` iterates over each element as it's
|
// This `range` iterates over each element as it's
|
||||||
|
Loading…
x
Reference in New Issue
Block a user