Feb 24

Set goland to use gofumpt on file save 不指定

felix021 @ 2023-2-24 11:43 [随想] 评论(0) , 引用(0) , 阅读(1711) | Via 本站原创 | |
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
发表评论
表情
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
打开HTML
打开UBB
打开表情
隐藏
记住我
昵称   密码   *非必须
网址   电邮   [注册]