package main
import(
"fmt"
)
func main() {
channelInt := make(chan int)
for i:= 0; i < 5; i++ {
j := i
go func(j int) {
channelInt <- j
}(j)
}
fmt.Printf("==>%d\n", <-channelInt)
}
有疑问加站长微信联系(非本文作者)