()
| 12 | ) |
| 13 | |
| 14 | func ExampleErrorPool() { |
| 15 | p := New().WithErrors() |
| 16 | for i := 0; i < 3; i++ { |
| 17 | i := i |
| 18 | p.Go(func() error { |
| 19 | if i == 2 { |
| 20 | return errors.New("oh no!") |
| 21 | } |
| 22 | return nil |
| 23 | }) |
| 24 | } |
| 25 | err := p.Wait() |
| 26 | fmt.Println(err) |
| 27 | // Output: |
| 28 | // oh no! |
| 29 | } |
| 30 | |
| 31 | func TestErrorPool(t *testing.T) { |
| 32 | t.Parallel() |
nothing calls this directly
no test coverage detected
searching dependent graphs…