标题:Set goland to use gofumpt on file save 出处:Felix021 时间:Fri, 24 Feb 2023 11:43:31 +0000 作者:felix021 地址:https://www.felix021.com/blog/read.php?2244 内容: 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. Generated by Bo-blog 2.1.0