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: use errors.New to replace fmt.Errorf with no parameters will much better #2301

Closed
wants to merge 1 commit into from

Conversation

ChengenH
Copy link

use errors.New to replace fmt.Errorf with no parameters will much better

@ChengenH ChengenH requested a review from a team as a code owner April 21, 2024 03:10
@wolfogre
Copy link
Member

No, I don't see it will be "much better" when fmt.Errorf with no parameters is the same as errors.New.

image

Code is changing as long as the project is being maintained, and it will be annoyed once the maintainers wants to add new stuff to errors.New("abc"), they have to import fmt and change the function to fmt.Errorf, while fmt.Errorf("abc") -> fmt.Errorf("abc %v: %w", v, err) is much easier.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants