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

Ditto with SublimeText and Atom. Installing the popular Go plugins (GoSublime and go-plus respectively) makes the import thing a non-issue. The appropriate packages are imported and unused imports are removed every time the file is saved.

I suspect that the OP might not have used Go for very long if he didn't discover any of these solutions.



I'm aware of them, and grateful for the handful of people that created those solutions and wrote them up, to help the many thousands of others that run into the import annoyance when they're learning Go.

I personally don't use them because the emacs version never worked quite right for me and at that point I'd rather just deal with Go directly and not have an additional annoyance.


Just a suggestion, but if you plan to execute `go build` at the terminal, is it possible to execute `go-imports` just before? I think using this and gofmt (again from the command line) makes developing in Go very smooth.

I agree that it is a shame that these options aren't built-in and many newbies would have to discover them on their own.


I should drop that into my (small) build script, yeah. thanks.




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

Search: