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 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

Ice Ice Baby

In Defense of Silly Programs

To learn a  programming language, you must either Write a compiler for language Write programs in the language A handful of canonical first-programs have risen in the past few years. TODO lists and Blog Engines are popular because they’re easy enough to start and difficult enough to cover a non-trivial swath of a language’s ecosystem such as documentation, packages/modules, build systems, package manager, support network, and so forth. They also generally require integration with a database, which at least in most OO languages can lead to understanding at least one major framework and consequently that framework’s abstractions, typically ORM-y, for … Continue reading In Defense of Silly Programs