-
Notifications
You must be signed in to change notification settings - Fork 17.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
proposal: x/sync/errgroup: optionally collect all errors #72101
Comments
If I'm understanding correctly I think this is the same as what I asked in #57534 (comment), and the errgroup author responded in #57534 (comment) with a justification against this idea. I don't have a strong feeling about this myself; I'm just sharing this to link the discussions together. |
@apparentlymart I think this suggestion is slightly different. Rather than having a |
There's a more recent objection to having a method get all of them
|
Thanks, that is convincing. We aren't going to do this. @imjasonh This might be suitable for a different package, but it should probably start out as a third-party package rather than one in x/sync. Thanks. |
Thanks, I appreciate your consideration and discussion. |
Proposal Details
When using
errgroup.Group
, the current behavior is to fail and return the first error that's encountered. This works great.errgroup
is consistently one of my favorite packages to use.But, sometimes I want to collect and report all errors at the end.
Luckily, we have
errors.Join
to do just this!I'd like to propose either an optional method to make
errgroup
collect errors, or a type/package/something to do what errgroup does, with this behavior.I'm open to any naming or structure you folks would recommend, and I'd be happy to send a CL to implement it if there's interest.
The text was updated successfully, but these errors were encountered: