You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
golang.org/x/sync/errgroup returns the first non-nil error (if any) of all go routines managed by it. With the introduction of wrapped errors in go 1.20 this package could be updated to return a single error that wraps all errors returned by the routines started with it. The change would be minimal, essentially only replacing the errOncer with a mutex and errors.Join.
I am unsure if the change would breaking existing code using errgroup. At the moment users shouldn't rely on any specify error be returned, while with the change one can check if a specific error has occurred with errors.Is or errors.As.
The text was updated successfully, but these errors were encountered:
I raised a similar idea in the discussion of #57534 and the original author of errgroup responded that it's more appropriate to return only the error that causes the context to be cancelled.
That seems plausible to me so I didn't push that idea any further, but if you intend to pursue this proposal you may wish to consider that feedback and incorporate a response into your proposal.
golang.org/x/sync/errgroup returns the first non-nil error (if any) of all go routines managed by it. With the introduction of wrapped errors in go 1.20 this package could be updated to return a single error that wraps all errors returned by the routines started with it. The change would be minimal, essentially only replacing the
errOncer
with a mutex anderrors.Join
.I am unsure if the change would breaking existing code using
errgroup
. At the moment users shouldn't rely on any specify error be returned, while with the change one can check if a specific error has occurred witherrors.Is
orerrors.As
.The text was updated successfully, but these errors were encountered: