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

Use the system errors package instead of github.com/pkg/errors #762

Merged
merged 2 commits into from
Nov 7, 2023

Conversation

skitt
Copy link
Member

@skitt skitt commented Oct 16, 2023

... where appropriate.

@submariner-bot
Copy link
Contributor

🤖 Created branch: z_pr762/skitt/drop-pkg-errors

@skitt skitt force-pushed the drop-pkg-errors branch 3 times, most recently from 390f8d7 to 6eb101a Compare October 16, 2023 12:28
@tpantelis
Copy link
Contributor

I like Wrap and Wrapf - saves extra if statements and having to remember %w if using fmt.Errorf. It's disappointing the project was archived. But that doesn't mean we can't still use it, right?

@skitt
Copy link
Member Author

skitt commented Oct 16, 2023

I like Wrap and Wrapf - saves extra if statements and having to remember %w if using fmt.Errorf. It's disappointing the project was archived. But that doesn't mean we can't still use it, right?

Yeah, that’s part of the discussion — the project is archived but it’s simple enough, and I don’t think there’s much risk of needing a security fix there, so it should be fine to continue using it.

I like the wrappers too; I do however feel that they sometimes lead to “write-only” code that requires too much effort to unpack, for example https://github.com/submariner-io/admiral/pull/762/files#diff-45d75e9613d7175cf26d0ec83c4c5402ce87085cafb3acddf321693311baa3a1R463-R468. But most instances are convenient and easy enough to follow (once people realise that the wrappers don’t do anything if the error is nil).

@tpantelis
Copy link
Contributor

I think we agreed we can keep using github.com/pkg/errors. If so, should we just close this?

@skitt skitt changed the title Drop github.com/pkg/errors Use the system errors package instead of github.com/pkg/errors Nov 3, 2023
@skitt
Copy link
Member Author

skitt commented Nov 3, 2023

I think we agreed we can keep using github.com/pkg/errors. If so, should we just close this?

I wanted to rework it to switch to "errors" where appropriate.

... where appropriate.

Signed-off-by: Stephen Kitt <skitt@redhat.com>
@tpantelis tpantelis enabled auto-merge (rebase) November 7, 2023 16:53
@tpantelis tpantelis merged commit f6063b1 into submariner-io:devel Nov 7, 2023
16 checks passed
@submariner-bot
Copy link
Contributor

🤖 Closed branches: [z_pr762/skitt/drop-pkg-errors]

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.

4 participants