3 ms·
I used to want that too, but I've paid pretty close attention over the last couple years and that error has caught a nonzero number of what would otherwise have
by tptacek 7y ago
I used to want that too, but I've paid pretty close attention over the last couple years and that error has caught a nonzero number of what would otherwise have been runtime bugs.
- napsterbr 7y agoFor production I agree 100% with you, to the point I think it's just sloppy to leave unused variables and imports hanging around. But during development that's just a needless obstacle. I may comment large blocks of code and I don't want to scan each import to make sure they are no longer used.
- tptacek 7y agoI assume at this point that at least a plurality of Go developers are using goimports and having this stuff handled automatically. That's probably another reason my opinion on this shifted.
- kstenerud 7y agoIf IDEs did the same for unused variables, I'd probably shift as well, but right now, commenting out a line quickly degenerates into a game of whack a mole, because it causes a previous calculation to become "unused", and commenting out that line causes two more things to become unused, etc. The last thing I want during debugging is to have to fight the compiler at every step. Debugging is the main reason I wrote this mod.