mirror of
https://github.com/vbatts/talks.git
synced 2024-12-29 10:06:33 +00:00
17 lines
185 B
Go
17 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
|
||
|
}
|