Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
errgroup currently only allows the user to get the first error. It is sometimes desirable to get all errors from the goroutines launched.
Below are some recent examples where I was doing some uniform work across multiple machines and needed to use sync.WaitGroup rather than errgroup as I wanted to collect all errors.
Example 1: Running uniform cleanup across multiple machines and wanting to see each failure.
Example 2: Running uniform setup across multiple machines and needing only a subset to succeed in order for the pool to be available.
Proposal: One possible solution would be to add a WaitAll() function which returns error rather than error.
I am happy to work on sending a patch for this if the feature request and API make sense.
The purpose of the
If you want all of the errors (and don't want to cancel the
Furthermore, at the moment the