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

proposal: cmd/vet: add static analysis pass to check whether bytes.Buffer should be replace by strings.Builder #54988

Closed
cuiweixie opened this issue Sep 10, 2022 · 3 comments

Comments

@cuiweixie
Copy link
Contributor

Since strings.Builder has better performance that bytes.Buffer in join strings. I think we can add a static analysis pass for our user to check whether the bytes.Buffer can be replaced by strings.Builder.

@gopherbot gopherbot added this to the Proposal milestone Sep 10, 2022
@robpike
Copy link
Contributor

robpike commented Sep 10, 2022

It is not an error to use bytes.Buffer, and it often matters little which one to use. In tests, for example, it is usually unimportant.

I presume you are referring to adding a check to vet, but this proposal would not satisfy the criteria in cmd/vet/README.

@rsc rsc changed the title proposal: add static analysis pass to check whether bytes.Buffer should be replace by strings.Builder proposal: cmd/vet: add static analysis pass to check whether bytes.Buffer should be replace by strings.Builder Sep 28, 2022
@rsc
Copy link
Contributor

rsc commented Sep 28, 2022

Based on the discussion above, this proposal seems like a likely decline.
— rsc for the proposal review group

@rsc
Copy link
Contributor

rsc commented Oct 6, 2022

No change in consensus, so declined.
— rsc for the proposal review group

@rsc rsc closed this as completed Oct 6, 2022
@golang golang locked and limited conversation to collaborators Oct 6, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants