GOLand enable auto-formatting on file-save with go fmt

The option On Save action in the IDE is no longer available and we are all required to start using File Watchers instead.

Enable go fmt:

  1. Go to Settings | Tools | File Watchers
  2. Click + button and select go fmt
  3. Use default values as they get the job done just fine
  4. In Advanced Options select:
  • Auto-save edited files to trigger the watcher
  • Trigger the watcher on external changes

5. Click OK and Apply

So now whenever you save the file it will be formatted for you!

--

--

Przemyslaw Ozgo

I eat Docker for breakfast, Ansible for lunch and for dinner I usually have Jenkins, and I like to spice it up with Go and Bash.