x/tools/gopls/internal/analysis/modernize: add modernizer for WaitGroup.Go #73059
Labels
FeatureRequest
Issues asking for a new feature that does not need a proposal.
gopls
Issues related to the Go language server, gopls.
Tools
This label describes issues relating to any tools in the x/tools repository.
Milestone
The existing waitgroup analyzer reports misuses of wg.Add/Done. Now that WaitGroup.Go (#63796) is on course to be approved for go1.25, we should extend the analyzer to also report opportunities to use the new method instead of the old more complex code.
That is, it would report a diagnostic for:
and offer a fix that changes it to:
The criteria should be:
However, modernize is only part of gopls, whereas waitgroup is (soon to be) part of the cmd/vet suite, so some care is required to ensure that only gopls gets the proposed new behavior.
The text was updated successfully, but these errors were encountered: