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

Function hello

golang/go-study/go语言基础/并发/goroutine/启动单个goroutine.go:15–18  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

13var wg sync.WaitGroup
14
15func hello() {
16 fmt.Println("hello")
17 wg.Done() // 告知当前goroutine完成
18}
19
20func main() {
21 wg.Add(1) // 登记一个goroutine

Callers 1

mainFunction · 0.70

Calls 1

DoneMethod · 0.80

Tested by

no test coverage detected