-
-
Notifications
You must be signed in to change notification settings - Fork 64
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
Convert []error
to use multi errors available in 1.20
#117
Comments
Ah yes, I thought the same thing when I saw the release notes for 1.20. Yes this is a good idea, adding it to the backlog. |
@daveshanley is this still the approach you want to be followed? If so, I can work on this. |
I'd suggest just using errors.Join and return a single error. |
I would avoid working on this until the library is ready for 1.0, it's a major breaking change to the top level of the library in terms of signature. It's a small change with big consequences. |
@daveshanley I would suggest doing it ASAP as that will result in less people having to alter their code. |
Thanks for the wonderful library! After converting from a different library, I have a single suggestion!
The current code base returns multiple errors which is inconvenient to use if multiple errors are not useful to the caller. We could instead create an error that implements the
Unwrap() []error
method which can be used to retrieve multiple errors.Example implementation
The conversion would be easy, but would break the compatibility. As such it should probably wait for a v1 or v2 release.
See https://pkg.go.dev/errors#Join
The text was updated successfully, but these errors were encountered: