mirror of
https://github.com/vbatts/talks.git
synced 2024-12-27 09:06:30 +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
|
|
}
|