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

Function main

golang/go-study/go语言基础/并发/goroutine/exercise.go:10–19  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

8var wg3 sync.WaitGroup
9
10func main() {
11 for i := 0; i < 5; i++ {
12 wg3.Add(1)
13 go func(i int) {
14 defer wg3.Done()
15 fmt.Println(i)
16 }(i)
17 }
18 wg3.Wait()
19}

Callers

nothing calls this directly

Calls 3

DoneMethod · 0.80
AddMethod · 0.45
WaitMethod · 0.45

Tested by

no test coverage detected