mirror of
https://github.com/vbatts/talks.git
synced 2024-11-16 05:28:37 +00:00
16 lines
185 B
Go
16 lines
185 B
Go
// +build ignore
|
|
|
|
package main
|
|
|
|
func main() {
|
|
// START1 OMIT
|
|
c := make(chan int)
|
|
go func() {
|
|
for i := 0; i < 10; i++ {
|
|
c <- i
|
|
}
|
|
close(c)
|
|
}()
|
|
println(<-c)
|
|
// STOP1 OMIT
|
|
}
|