https://godoc.org/golang.org/x/tools/cmd/goimports
It says to add the following to .emacs:
(setq gofmt-command "goimports")
(add-to-list 'load-path "/home/you/somewhere/emacs/")
(require 'go-mode-autoloads)
(add-hook 'before-save-hook 'gofmt-before-save)
go-mode-autoloads is no longer used by go-mode (see dominikh/go-mode.el#222), and this line will probably produce an error. That line should be removed.
Also, I found the add-to-list line confusing, because it's not clear from context whether this is optional or required. Might be good to remove that, and then say something like "This searches load-path for goimports, so you may need to add the goimports location to load-path." (Sorry for this separate issue. Feel free to tell me to break it out to a separate issue if it's too large or controversial.)