package main
import (
"fmt"
)
func main() {
for i := 0; i < 10; i++ {
go Go()
}
}
func GO(c chan bool, index int) {
a := 1
for i := 0; i < 1000000; i++ {
a += i
}
fmt.Println(a)
}
结果:
[ `go run 并发.go` | done: 265.0151ms ]
# command-line-arguments
.\并发.go:10:6: undefined: Go
有疑问加站长微信联系(非本文作者))