Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I think you missed the point of the comment - no matter if you're removing or adding imports, the tool (goimports) should do it for you automatically. It's easy to setup with any modern text editor (VSCode, emacs, etc)


What of when there are duplicate symbols with the same name? And this doesn’t help with unused locals. Also, another commenter pointed out that unused local functions don’t get flagged. Go authors probably realized that making people delete and restore entire function bodies during debugging was too much, but they could still convince people to be okay with deleting and restoring import statements and local variable definitions.


It's much rarer that an unused function indicates an error.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: