x/tools/gopls: Adding a warning when never actually consuming the contents of a string builder #52355
Labels
FeatureRequest
Issues asking for a new feature that does not need a proposal.
FrozenDueToAge
gopls
Issues related to the Go language server, gopls.
Tools
This label describes issues relating to any tools in the x/tools repository.
WaitingForInfo
Issue is not actionable because of missing required information, which needs to be provided.
Milestone
When using a string builder like this:
no warning will be displayed, since the declared variable is used. On other occasions, such as not passing a reference to a json unmarshal, the linter displays a warning that the user might want something different. I think it would be pretty cool to have such a warning when never calling .String() or returning the string builder.
The text was updated successfully, but these errors were encountered: