all goroutines are asleep deadlock
问题 I am trying to play around with goroutines and channel package main import ( "fmt" "math/rand" "time" ) func boring(msg string) <-chan string { c := make(chan string) go func() { for i := 0; ; i++ { c <- fmt.Sprintf("%s %d", msg, i) time.Sleep(time.Duration(rand.Intn(1e3)) * time.Millisecond) } }() return c } func main() { c := fanInNew(boring("joe"), boring("anh")) for i := 0; i < 10; i++ { fmt.Println(<-c) } fmt.Println("You both are boring, I am leaving") } func fanInNew(input1, input2 <