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

fix: use errors.New for const errors #181

Merged
merged 2 commits into from
May 23, 2024
Merged

Conversation

cristaloleg
Copy link
Contributor

Overview

Small cleanup PR. Use errors.New when parameter is const (instead of fmt.Errorf).

@Wondertan
Copy link
Member

Is there a fundamental difference between those? I always assumed the resulting errors are sort of identical

@cristaloleg
Copy link
Contributor Author

cristaloleg commented May 22, 2024

Nah, underneath, it will be the same error—the only thing why errors.New is better in this context is that nobody in the future will ask: are we missing params here?

(Hmm, I recall one more pro: when we migrated to another error library, we had a smaller diff due to the absence of such patterns).

Copy link
Member

@renaynay renaynay left a comment

Choose a reason for hiding this comment

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

Fine with this, thanks :)

@renaynay renaynay merged commit 9979590 into main May 23, 2024
4 checks passed
@renaynay renaynay deleted the use-errors.New-for-const-errors branch May 23, 2024 12:21
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.

None yet

3 participants