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 use of github.com/pkg/errors and golang.org/x/xerrors with Go stdlib functionality #12603

Merged
merged 4 commits into from
Jul 22, 2020

Conversation

tklauser
Copy link
Member

Use the Go stdlib error handling functionality (errors package and fmt.Errorf) available since Go 1.13 instead of the external packages github.com/pkg/errors and golang.org/x/xerrors.

Reviewable by commit.

Use fmt.Errorf instead of the external github.com/pkg/errors to wrap
error values.

Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Use errors.Is instead of errors.Cause from the external
github.com/pkg/errors to check wrapped error values.

Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
@tklauser tklauser added kind/cleanup This includes no functional changes. release-note/misc This PR makes changes that have no direct user impact. labels Jul 21, 2020
@tklauser tklauser requested a review from a team as a code owner July 21, 2020 09:46
@tklauser tklauser requested review from a team July 21, 2020 09:46
@tklauser tklauser requested review from a team as code owners July 21, 2020 09:46
Consistently use fmt.Errorf instead of the external
github.com/pkg/errors to wrap error values.

Also switch existing uses of fmt.Errorf to use the %w verb to wrap the
underlying error properly.

Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
This will pull in cilium/ebpf#116 which dropped use of
golang.org/x/errors and uses the Go stdlib errors package instead.

Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
@tklauser tklauser force-pushed the pr/tklauser/drop-pkg-errors branch from 16498c7 to a1cd0b8 Compare July 21, 2020 10:05
@tklauser
Copy link
Member Author

test-me-please

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.001%) to 37.006% when pulling a1cd0b8 on pr/tklauser/drop-pkg-errors into 1924556 on master.

@maintainer-s-little-helper maintainer-s-little-helper bot added the ready-to-merge This PR has passed all tests and received consensus from code owners to merge. label Jul 22, 2020
@rolinh rolinh merged commit 0685c1b into master Jul 22, 2020
@rolinh rolinh deleted the pr/tklauser/drop-pkg-errors branch July 22, 2020 09:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/cleanup This includes no functional changes. ready-to-merge This PR has passed all tests and received consensus from code owners to merge. release-note/misc This PR makes changes that have no direct user impact.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants