Code
Hub
Workspaces
Connect
Indexed graphs
Engine
MCP
copy
hub
/
github.com/mao888/golang-guide
/ hello
Function
hello
golang/go-study/go语言基础/并发/并发安全和锁/WaitGroup/waitgroup.go:15–18 ·
view source on GitHub ↗
()
Source
from the content-addressed store, hash-verified
13
var
wg sync.WaitGroup
14
15
func
hello() {
16
defer
wg.Done()
17
fmt.Println(
"Hello Goroutine!"
)
18
}
19
func
main() {
20
wg.Add(1)
21
go
hello()
// 启动另外一个goroutine去执行hello函数
Callers
1
main
Function · 0.70
Calls
1
Done
Method · 0.80
Tested by
no test coverage detected