Code
Hub
Workspaces
Connect
Indexed graphs
Engine
MCP
copy
hub
/
github.com/mao888/golang-guide
/ main
Function
main
golang/go-study/go语言基础/并发/并发安全和锁/Map/map.go:28–40 ·
view source on GitHub ↗
()
Source
from the content-addressed store, hash-verified
26
}
27
28
func
main() {
29
wg := sync.WaitGroup{}
30
for
i := 0; i < 10; i++ {
31
wg.Add(1)
32
go
func
(i int) {
33
key := strconv.Itoa(i)
34
set(key, i)
35
fmt.Printf(
"k=:%v,v=:%v\n"
, key, get(key))
36
wg.Done()
37
}(i)
38
}
39
wg.Wait()
40
}
Callers
nothing calls this directly
Calls
5
set
Function · 0.85
get
Function · 0.85
Done
Method · 0.80
Add
Method · 0.45
Wait
Method · 0.45
Tested by
no test coverage detected