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
Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request. Searching for pre-existing feature requests helps us consolidate datapoints for identical requirements into a single place, thank you!
Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request.
If you are interested in working on this issue or have submitted a pull request, please leave a comment.
Per, pkg/errors#245 github.com/pkg/errors is deprecated and read-only. Golang's standard library now has support for wrapping errors, so we can switch to that.
Another benefit if right now there's code that looks like:
if !os.IsNotExist(err) {
return valid.RepoCfg{}, errors.Wrapf(err, "unable to read %s file", repoConfigFile)
}
// Don't wrap os.IsNotExist errors because we want our callers to be
// able to detect if it's a NotExist err.
return valid.RepoCfg{}, err
Because later code calls os.IsNotExist on the error. The documentation for os.IsNotExist recommends using errors.Is(err, ErrNotExists, which can walk "up the chain" of a wrapped error, thus we can get rid of that entire block above.
Describe the solution you'd like
Eliminate pkg/errors as a dependency.
Describe the drawbacks of your solution
There are a lot of calls to errors.Wrapf() that will need to be changed, but I imagine it'll be pretty mechanical.
Another concern is a lot of merge conflicts because this code is all over the code base, hopefully we can find ways to chunk it up and/or do it quickly
Describe alternatives you've considered
There are other error wrapping packages we could use, but it seems like no reason not to just the one in the stdlib.
The text was updated successfully, but these errors were encountered:
Community Note
Describe the user story
Per, pkg/errors#245 github.com/pkg/errors is deprecated and read-only. Golang's standard library now has support for wrapping errors, so we can switch to that.
Another benefit if right now there's code that looks like:
Because later code calls
os.IsNotExist
on the error. The documentation foros.IsNotExist
recommends usingerrors.Is(err, ErrNotExists
, which can walk "up the chain" of a wrapped error, thus we can get rid of that entire block above.Describe the solution you'd like
Eliminate pkg/errors as a dependency.
Describe the drawbacks of your solution
There are a lot of calls to errors.Wrapf() that will need to be changed, but I imagine it'll be pretty mechanical.
Another concern is a lot of merge conflicts because this code is all over the code base, hopefully we can find ways to chunk it up and/or do it quickly
Describe alternatives you've considered
There are other error wrapping packages we could use, but it seems like no reason not to just the one in the stdlib.
The text was updated successfully, but these errors were encountered: