Source file tour/concurrency/buffered-channels.go
1 //go:build OMIT 2 3 package main 4 5 import "fmt" 6 7 func main() { 8 ch := make(chan int, 2) 9 ch <- 1 10 ch <- 2 11 fmt.Println(<-ch) 12 fmt.Println(<-ch) 13 } 14
1 //go:build OMIT 2 3 package main 4 5 import "fmt" 6 7 func main() { 8 ch := make(chan int, 2) 9 ch <- 1 10 ch <- 2 11 fmt.Println(<-ch) 12 fmt.Println(<-ch) 13 } 14