Feb
24
Set goland to use gofumpt on file save
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.
转载请注明出自 ,如是转载文则注明原出处,谢谢:)
RSS订阅地址: https://www.felix021.com/blog/feed.php 。
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.
欢迎扫码关注:
转载请注明出自 ,如是转载文则注明原出处,谢谢:)
RSS订阅地址: https://www.felix021.com/blog/feed.php 。