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)
}
<a href="/user/hznuyyh" title="@hznuyyh">@hznuyyh</a> <a href="/user/Dracula" title="@Dracula">@Dracula</a> <a href="/user/golwei" title="@golwei">@golwei</a> <a href="/user/Leigg" title="@Leigg">@Leigg</a> <a href="/user/kwely" title="@kwely">@kwely</a> 谢谢大家 :star2:
#7
更多评论