News for hackers. Stuff that matters.
Re:Go: What We Got Right, What We Got Wrong by cangeroo on Saturday January 06, 2024 @04:28AM (#38889925)
I might not have used `goimports` before. I read now that it also auto-imports when you uncomment. That's neat, but it could auto-import the wrong thing, and I'm not sure how it would handle conflicts. It still seems worse than just ignoring my unused imports. Unused imports should be more of a linting thing? If the compiler knows its unused, I don't see why it can't just ignore it.
Re:Go: What We Got Right, What We Got Wrong by cwbriscoe on Saturday January 06, 2024 @01:52PM (#38894085)
Yes, it can import the wrong thing (or version) but it doesn't happen that often in my experience. If you use the libraries in other files it can go off of what is already in your go.mod file.