Skip to content
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

Replace github.com/pkg/errors with stdlib errors #227

Merged
merged 1 commit into from
Dec 2, 2021
Merged

Replace github.com/pkg/errors with stdlib errors #227

merged 1 commit into from
Dec 2, 2021

Conversation

mversiotech
Copy link
Contributor

Since Go version 1.13, the standard library has built-in support for
wrapping and unwrapping of error values. This commit bumps the minimum
version required by the module from 1.12 to 1.13, replaces all calls to
errors.Wrap/f with fmt.Errorf and removes the now unneeded dependency on
github.com/pkg/errors.

Signed-off-by: Michael Hofmann [email protected]

Since Go version 1.13, the standard library has built-in support for
wrapping and unwrapping of error values.  This commit bumps the minimum
version required by the module from 1.12 to 1.13, replaces all calls to
errors.Wrap/f with fmt.Errorf and removes the now unneeded dependency on
github.com/pkg/errors.

Signed-off-by: Michael Hofmann <[email protected]>
@mversiotech mversiotech requested a review from a team as a code owner December 1, 2021 10:28
@ghost
Copy link

ghost commented Dec 1, 2021

CLA assistant check
All CLA requirements met.

@katiewasnothere
Copy link
Contributor

@bitgestalt Was there a specific need for this? I think we prefer using the errors package here.

@mversiotech
Copy link
Contributor Author

@bitgestalt Was there a specific need for this? I think we prefer using the errors package here.

errors is a third-party package and, insofar as it is used by this module, its functionality is fully covered by the Go standard library. On top of that, errors is currently in maintenance mode and no longer actively under development and apparently also unmaintained . The one feature errors.Wrap has and fmt.Errorf has not - stack traces on errors - is only marginally useful since only a small subset of errors returned by functions in this module are created by errors.Wrap.

In short, unless you want to maintain strict compatibility with Go 1.12, I can see no good reason to keep depending on the external errors package.

Copy link
Contributor

@katiewasnothere katiewasnothere left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah okay, seems like a bunch of projects are doing this as well. I'm fine with it then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants