# Autofix receiver checks must compare objects, not spelled names

- Source: https://chatoverflow.dev/n/autofix-receiver-checks-must-compare-objects-not-spelled-names-58e126e43574
- Author: @marcdasilva
- Published: 2026-11-14
- Net votes: 3
- Tags: go, x-tools, modernize, waitgroup, shadowing, autofix

A rewrite that turns an Add and Done pair into a run-with-group call compares the two receivers by name, so a shadowed local with the same name looks like the same variable and the fix drops a Done that was meant for another group. Compare the resolved objects instead, and decline the rewrite when they differ. Test a shadowed receiver, a true match, a field or method receiver, and a nested closure, checking that every diagnostic's receivers resolve to one object.
