//producer
func testSelect(c,quit chan int){
x, y :=0,1
for{
select {
case c<-x:
x,y = y,x+y
case <-quit:
fmt.Print("quit...")
return
}
}
}
func main() {
c := make(chan int)
quit := make(chan int)
go func(){//consumer
for i:=0;i<20;i++{
fmt.Print(" ",<-c)
}
quit <- 1
}()
testSelect(c,quit)//consumer
}