Go channels and deadlock
问题 I'm trying to understand the Go language. I tried to create two goroutines that chain the flow between them using two channels: func main() { c1 := make(chan int) c2 := make(chan int) go func() { for i := range c1{ println("G1 got", i) c2 <- i } }() go func() { for i := range c2 { println("G2 got", i) c1 <- i } }() c1 <- 1 time.Sleep(1000000000 * 50) } As expected this code prints: G1 got 1 G2 got 1 G1 got 1 G2 got 1 .... Until the main function exits. But if I send another value to one of