MCPcopy Index your code
hub / github.com/sourcegraph/conc / ExampleWaitGroup

Function ExampleWaitGroup

waitgroup_test.go:11–25  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

9)
10
11func ExampleWaitGroup() {
12 var count atomic.Int64
13
14 var wg WaitGroup
15 for i := 0; i < 10; i++ {
16 wg.Go(func() {
17 count.Add(1)
18 })
19 }
20 wg.Wait()
21
22 fmt.Println(count.Load())
23 // Output:
24 // 10
25}
26
27func ExampleWaitGroup_WaitAndRecover() {
28 var wg WaitGroup

Callers

nothing calls this directly

Calls 2

GoMethod · 0.95
WaitMethod · 0.95

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…