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

dynamicFmtString: use rather fix errors.New than fmt.Errorf("%s" #1381

Open
catenacyber opened this issue Oct 25, 2023 · 2 comments
Open

dynamicFmtString: use rather fix errors.New than fmt.Errorf("%s" #1381

catenacyber opened this issue Oct 25, 2023 · 2 comments

Comments

@catenacyber
Copy link

As it is faster

Cf catenacyber/perfsprint#3 (comment)

@cristaloleg
Copy link
Member

I don't get it. Can you clarify what exactly you wan to say by posting this link?

Thanks

@catenacyber
Copy link
Author

Sorry for the too harsh description

https://go-critic.com/overview.html#dynamicfmtstring states that fmt.Errorf(msg) gets changed into fmt.Errorf("%s", msg) I propose that it should be changed into errors.New(msg) as it avoids the string interpolation and is faster.

Is this clearer ?

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

No branches or pull requests

2 participants