Quantcast
Channel: Felix021
Viewing all articles
Browse latest Browse all 125

Set goland to use gofumpt on file save

$
0
0
Why: kitex framework is using gofumpt as linter in gitlab CI, but goland defaults to use gofmt, which enforces weaker rules.

Procedure:

0. $ go install mvdan.cc/gofumpt@v0.2.0  # or any version as you need

1. Install file watcher plugin in goland settings;

2. Go to settings -> Tools -> File Watchers:

2.1. Click on "+", and choose "go fmt"

2.2. Replace "Program:" to be the full path of your gofumpt binary

2.3. Modify "Arguments:" to be "-w $FilePath$"

2.4 OK & OK again.

Viewing all articles
Browse latest Browse all 125

Trending Articles