问答详情
源自:5-6 Go语言-通道的更多种类

答案正确,但是打印不出来

我填的0,为什么send出不来? func main() { var myChannel = make(chan int, (0)) var number = 6 go func() { var sender Sender = myChannel sender <- number fmt.Println("Sent!") }() go func() { var receiver Receiver = myChannel fmt.Println("Received!", <-receiver) }() time.Sleep(time.Second) }

提问者:杰伦窗外的小麻雀 2016-05-11 14:43

个回答

  • 慕姐0836278
    2018-07-15 20:42:19

    哈哈。搞定了就好

  • 杰伦窗外的小麻雀
    2016-05-11 14:48:46

    已经解决,不必解答了哦