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

Linter checks for fmt.Errorf error wrap misuse #812

Merged
merged 3 commits into from
Feb 23, 2024
Merged

Linter checks for fmt.Errorf error wrap misuse #812

merged 3 commits into from
Feb 23, 2024

Conversation

ffranr
Copy link
Contributor

@ffranr ffranr commented Feb 23, 2024

This PR enables a linter which checks for fmt.Errorf error wrap misuse.

It disallows:

fmt.Errorf("%v", err)

And allows:

fmt.Errorf("%w", err)

This commit enables a linter which checks to ensure that we do not
incorrectly use a non-wrapping format verb when trying to wrap an error
with `fmt.Errorf`.
@ffranr ffranr requested review from guggero and jharveyb February 23, 2024 14:45
Copy link
Member

@guggero guggero left a comment

Choose a reason for hiding this comment

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

Very nice, thanks a lot!
Not sure about the last commit though.

proof/verifier.go Outdated Show resolved Hide resolved
Copy link
Contributor

@jharveyb jharveyb left a comment

Choose a reason for hiding this comment

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

Looks good! Diff larger than expected (in a good way).

@ffranr ffranr added this pull request to the merge queue Feb 23, 2024
Merged via the queue into main with commit f756868 Feb 23, 2024
14 checks passed
@guggero guggero deleted the lint-err-wrap branch February 23, 2024 16:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: ✅ Done
Development

Successfully merging this pull request may close these issues.

3 participants