Code
Hub
Workspaces
Connect
Indexed graphs
Engine
MCP
copy
hub
/
github.com/mao888/golang-guide
/ main
Function
main
golang/go-study/go语言基础/并发/goroutine/启动单个goroutine.go:20–25 ·
view source on GitHub ↗
()
Source
from the content-addressed store, hash-verified
18
}
19
20
func
main() {
21
wg.Add(1)
// 登记一个goroutine
22
hello()
23
fmt.Println(
"你好"
)
24
wg.Wait()
// 阻塞等待登记对goroutine完成
25
}
Callers
nothing calls this directly
Calls
3
hello
Function · 0.70
Add
Method · 0.45
Wait
Method · 0.45
Tested by
no test coverage detected