GOLand enable auto-formatting on file-save with go fmt
Jan 8, 2021
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:
- Go to
Settings | Tools | File Watchers
- Click
+
button and selectgo fmt
- Use
default
values as they get the job done just fine - 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!