Code
Hub
Workspaces
Connect
Indexed graphs
Engine
MCP
copy
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
8
var
wg3 sync.WaitGroup
9
10
func
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
Done
Method · 0.80
Add
Method · 0.45
Wait
Method · 0.45
Tested by
no test coverage detected