MCPcopy
hub / github.com/tinygo-org/tinygo / TestWaitGroup

Function TestWaitGroup

src/sync/waitgroup_test.go:26–35  ·  view source on GitHub ↗

TestWaitGroup tests the typical usage of WaitGroup.

(t *testing.T)

Source from the content-addressed store, hash-verified

24
25// TestWaitGroup tests the typical usage of WaitGroup.
26func TestWaitGroup(t *testing.T) {
27 const n = 5
28 var wg sync.WaitGroup
29 wg.Add(n)
30 for i := 0; i < n; i++ {
31 go wg.Done()
32 }
33
34 wg.Wait()
35}

Callers

nothing calls this directly

Calls 3

AddMethod · 0.95
DoneMethod · 0.95
WaitMethod · 0.95

Tested by

no test coverage detected