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
But this makes it incredibly difficult, without a recursive function, to pull the underlying errors out when consuming them from ErrorPool#Wait() (the current approach also stores the errors in a more suboptimal manner leading to more memory usage, but this isn't a huge deal):
I don't mind doing the work for this, and it should be noted that it is backwards compatible w/ folks in the wild who have created their own functions like unwrapErrors above.
The text was updated successfully, but these errors were encountered:
akallu
changed the title
In errorPool, stored errors as []error instead of error
In ErrorPool, stored errors as []error instead of errorNov 6, 2024
akallu
changed the title
In ErrorPool, stored errors as []error instead of error
In ErrorPool, store errors as []error instead of flattened errorNov 6, 2024
@camdencheek sorry to bother, but I saw you active in a prior issue. Any thoughts on whether I can move ahead with contributing this code? Would love to get this ironed out if possible, and thanks for creating such a great library!
In the following snippet, we can see that errors are joined as they come in:
But this makes it incredibly difficult, without a recursive function, to pull the underlying errors out when consuming them from
ErrorPool#Wait()
(the current approach also stores the errors in a more suboptimal manner leading to more memory usage, but this isn't a huge deal):If the errors were kept as
[]error
, anderrors.Join(p.errs)
was done insideErrorPool#Wait()
, it would be a 1-liner to pull the underlying errors out:I don't mind doing the work for this, and it should be noted that it is backwards compatible w/ folks in the wild who have created their own functions like
unwrapErrors
above.The text was updated successfully, but these errors were encountered: