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
I've run into an issue recently where I've had to move some code from returning a static error to wrapping that error, and noticed that there's not a builtin way to compare errors using the errors.Is function. Would it be possible to add an ErrorIs (or similarly named) Checker implementation that uses errors.Is to assert error similarity?
I can't continue to use ErrorMatches in this case because it doesn't capture the correct meaning of my error check. I want to know that I'm returning a specific kind of error even if it's wrapped or the message is modified.
I've run into an issue recently where I've had to move some code from returning a static error to wrapping that error, and noticed that there's not a builtin way to compare errors using the
errors.Is
function. Would it be possible to add anErrorIs
(or similarly named)Checker
implementation that useserrors.Is
to assert error similarity?I can't continue to use
ErrorMatches
in this case because it doesn't capture the correct meaning of my error check. I want to know that I'm returning a specific kind of error even if it's wrapped or the message is modified.eg:
This is coming from go-git/go-git#1097 and https://github.com/go-git/go-git/blob/dcf0639a168c441de6753c6644322e6b619499ae/plumbing/transport/http/common.go#L414-L441 for some context.
The text was updated successfully, but these errors were encountered: