Sign in
go
/
talks
/
d966e39f9bb0bef5f9c34f29a40d664921e8e3b7
/
.
/
2012
/
chat
/
support
/
chan.go
blob: a21f7408da379a4f46c994c0210f3a1a75b3ee3c [
file
] [
log
] [
blame
]
// +build OMIT
package main
import "fmt"
func main() {
ch := make(chan int)
go fibs(ch)
for i := 0; i < 20; i++ {
fmt.Println(<-ch)
}
}
func fibs(ch chan int) {
i, j := 0, 1
for {
ch <- j
i, j = j, i+j
}
}