blob: 29d189e4790bf3fb4f0493728d70d50472eb6e20 [file] [log] [blame]
// +build OMIT
package main
import "fmt"
func fib(c chan int, n int) {
a, b := 0, 1
for i := 0; i < n; i++ {
a, b = b, a+b
c <- a // HL
}
close(c)
}
func main() {
c := make(chan int)
go fib(c, 10) // HL
for x := range c { // HL
fmt.Println(x)
}
}