x/tools/go/analysis/passes/waitgroup: report re-assignment of sync.WaitGroup variables #71357
Labels
Tools
This label describes issues relating to any tools in the x/tools repository.
Milestone
Proposal Details
Reassignment of variables of type
sync.WaitGroup
is likely to cause bugs due to the potential to overwrite a WaitGroup with a non-zero counter value with a WaitGroup that has a zero counter. I can't think of any scenarios whereby reassigning a variable of typesync.WaitGroup
would be required or useful. The waitgroup analysis pass should be extended to report reassignments ofsync.WaitGroup
variables.Example
Should this proposal be approved, I'd like to contribute the aforementioned changes.
The text was updated successfully, but these errors were encountered: