fatal error: all goroutines are asleep - deadlock
问题 I've the following Go code package main import ( "fmt" "math/rand" ) const ( ROCK int = iota PAPER SCISSORS ) type Choice struct { Who int //0 you 1 your opponent Guess int } //Win returns true if you win. func Win(you, he int) bool { ... } func Opponent(guess chan Choice, please chan struct{}) { for i := 0; i < 3; i++ { <-please choice := rand.Intn(3) who := 1 guess <- Choice{who, choice} please <- struct{}{} } } func GetChoice(you, he int) int { ... } var Cheat func(guess chan Choice) chan