WithFirstError configures the pool to only return the first error returned by a task. By default, Wait() will return a combined error.
()
| 55 | // WithFirstError configures the pool to only return the first error |
| 56 | // returned by a task. By default, Wait() will return a combined error. |
| 57 | func (p *ErrorPool) WithFirstError() *ErrorPool { |
| 58 | p.panicIfInitialized() |
| 59 | p.onlyFirstError = true |
| 60 | return p |
| 61 | } |
| 62 | |
| 63 | // WithMaxGoroutines limits the number of goroutines in a pool. |
| 64 | // Defaults to unlimited. Panics if n < 1. |