You can configure esformatter by changing ~/.esformatter
See the esformatter default https://github.com/millermedeiros/esformatter/blob/master/lib/preset/default.json for configuration examples.
You will need the esformatter binary available in your path to run the indent command
npm install -g esformatter
Using this and http://stackoverflow.com/questions/10969366/vim-automatically-formatting-golang-source-code-when-saving I made formatting automatic on write: