```
package main
import (
"fmt"
"time"
)
func main() {
ch1 := make(chan int)
ch2 := make(chan int)
go func() {
for {
select {
case v := <-ch1:
fmt.Println("ch1: ", v)
ch2 <- v // 到这里阻塞了
fmt.Println("send to ch2")
case v := <-ch2:
fmt.Println("ch2: ", v)
}
}
}()
ch1 <- 1
for {
time.Sleep(1 * time.Second)
}
}
```
程序输出
```
ch1: 1
```
有疑问加站长微信联系(非本文作者)