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

chore: move github.com/pkg/errors -> errors #339

Merged
merged 1 commit into from
Oct 27, 2022
Merged

chore: move github.com/pkg/errors -> errors #339

merged 1 commit into from
Oct 27, 2022

Conversation

jim-minter
Copy link
Member

Description of your changes

Replace all uses of errors.Wrap and errors.Wrapf with fmt.Errorf("... %w").
Replace all uses of github.com/pkg/errors.New with errors.New.
Fix up a few resulting lint issues (e.g. uses of errors.New(fmt.Sprintf()) and errors.New("Capitalized error message").

Fixes #338

I have:

  • Run make reviewable to ensure this PR is ready for review.

How has this code been tested

Ran make revieweable and make test

Special notes for your reviewer

@jim-minter
Copy link
Member Author

@ryanzhang-oss ptal

@jim-minter
Copy link
Member Author

@microsoft-github-policy-service agree [company="Microsoft"]

@jim-minter
Copy link
Member Author

@microsoft-github-policy-service agree company="Microsoft"

@jim-minter jim-minter changed the title move github.com/pkg/errors -> errors chore: move github.com/pkg/errors -> errors Oct 26, 2022
Copy link
Contributor

@ryanzhang-oss ryanzhang-oss left a comment

Choose a reason for hiding this comment

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

I wonder if there any difference between errors.New and fmt.ErrorF?

@jim-minter
Copy link
Member Author

I wonder if there any difference between errors.New and fmt.ErrorF?

I believe errors.New is marginally more efficient if the error message is static. I am not aware of any way to create a wrapped error in go apart from fmt.Errorf("%w"), however.

@jim-minter
Copy link
Member Author

@ryanzhang-oss I don't have write access to this repo so can't merge this PR. Please could you either help me join the right GitHub teams (I requested access yesterday but the requests haven't been approved yet) or hit merge?

@ryanzhang-oss ryanzhang-oss merged commit be5713a into Azure:main Oct 27, 2022
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.

Replace all the errros.wrap with %w
2 participants