Wrong:
func test() (c ch string) {
c <- "test"
return
}
Right:
func test() (c ch string) {
c = make(chan string)
c <- "test"
return
}
原文链接:https://www.f2er.com/go/190037.htmlWrong:
func test() (c ch string) {
c <- "test"
return
}
Right:
func test() (c ch string) {
c = make(chan string)
c <- "test"
return
}
原文链接:https://www.f2er.com/go/190037.html