3 ms·
goimports-on-save is an essential tool in your writing environment for go. It's not mentioned in the official docs, but using it completely obviates fiddling wi
by infogulch 12y ago
goimports-on-save is an essential tool in your writing environment for go. It's not mentioned in the official docs, but using it completely obviates fiddling with your import declarations ever again. While you're at it, you might as well turn go vet-on-save and go lint-on-save as well.
- Manishearth 12y agoYeah, it's been mentioned to me in this thread many times :) I so wish I had known beforehand ;p It would be nice to have a cheatsheet full of Go tips & tricks like gofmt/goreplace for replacing idents, and goimports-on-save, and whatnot. TBH I didn't really look for such non-in-built solutions when starting though, so I would have missed it anyway :P
- infogulch 12y ago> I didn't really look for such non-in-built solutions when starting I can't fault new users for this; the non-discoverability of these awesome tools for new users is a genuine fault of the Go ecosystem. Just a "Tips" or "Useful Tools" list at the end of the Getting Started page or the How to Write Go Code page would be better. Just to make users aware that such tools exist.