1
0
Fork 0
mirror of https://github.com/vbatts/talks.git synced 2025-01-08 14:57:08 +00:00
talks/2016/12-intro-to-golang/ugly0.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
}