Intellij IDEA: Run goimports on file save
goimports is a Go tool to remove unused and add missing imports. It also formats your code the same as go fmt. This is one solution for running goimports when saving *.go files in Intellij IDEA. If you have a better way (not involving snark about emacs), please comment. Assumptions You have goimports installed. If not, install with: go get code.google.com/p/go.tools/cmd/goimports You’re probably using the golang plugin. That plugin isn’t necessary for this goimports-on-save business, but if you’re using Intellij to write Go code then you might as well use the plugin, too. Big Picture Create a shell script to run goimports against … Continue reading Intellij IDEA: Run goimports on file save