MCPcopy
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

13var wg sync.WaitGroup
14
15func hello() {
16 defer wg.Done()
17 fmt.Println("Hello Goroutine!")
18}
19func main() {
20 wg.Add(1)
21 go hello() // 启动另外一个goroutine去执行hello函数

Callers 1

mainFunction · 0.70

Calls 1

DoneMethod · 0.80

Tested by

no test coverage detected