Sign in
go
/
website
/
e0bde46eda8a51f83f600be1b488deaaacc4a36b
/
.
/
_content
/
talks
/
2012
/
chat
/
support
/
chan.go
blob: fa27d245bcbaa63a75c4ba488cf08050b9d379ea [
file
] [
log
] [
blame
]
// +build ignore,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
}
}