14 ms·
This is a pet theory borne of no research at all, but from my fiddling around with Go I feel like this is a necessary feature for one reason: Go will refuse to
by amenhotep 2y ago
This is a pet theory borne of no research at all, but from my fiddling around with Go I feel like this is a necessary feature for one reason:
Go will refuse to compile if you have unused imports.
When I'd be playing around trying to get things to work, the import management thing was a lifesaver, I'd delete a line of code that was only a temporary exploration and its imports would disappear, I'd write something similar and the tool would add the imports back again. The annoyance of having to add them back constantly or always make sure there was some dummy "use" somewhere or manually comment them out and back in every time would be incredible to me.
It seems like it would be a lot better to simply warn on used imports and maybe refuse in release mode, but Go apparently thinks religious purity in one aspect is worth the price of making standard tooling remarkably lax in another?