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

Function ExampleWaitGroup_WaitAndRecover

waitgroup_test.go:27–38  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

25}
26
27func ExampleWaitGroup_WaitAndRecover() {
28 var wg WaitGroup
29
30 wg.Go(func() {
31 panic("super bad thing")
32 })
33
34 recoveredPanic := wg.WaitAndRecover()
35 fmt.Println(recoveredPanic.Value)
36 // Output:
37 // super bad thing
38}
39
40func TestWaitGroup(t *testing.T) {
41 t.Parallel()

Callers

nothing calls this directly

Calls 2

GoMethod · 0.95
WaitAndRecoverMethod · 0.95

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…