MCPcopy
hub / github.com/mao888/golang-guide / main

Function main

golang/go-study/go语言基础/并发/goroutine/启动多个goroutine.go:15–21  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

13}
14
15func main() {
16 for i := 0; i < 10; i++ {
17 wg2.Add(1) // 启动一个goroutine就登记+1
18 go hello2(i)
19 }
20 wg2.Wait() // 等待所有登记的goroutine都结束
21}

Callers

nothing calls this directly

Calls 3

hello2Function · 0.85
AddMethod · 0.45
WaitMethod · 0.45

Tested by

no test coverage detected