慕哥6287543
我发现提供配置更容易。golangci-lint"go.lintTool": "golangci-lint","go.lintFlags": [ "-c", "~/.dotfiles/.golangci.yml", "--issues-exit-code=0"],顺便说一句,您不需要启用所有默认 linters - thay 已经启用(请参阅参考)。但是如果你想通过 运行它,你可以定义(就像你做linter标志一样)。例如,下一个配置settings.json"go.lintTool": "golangci-lint","go.lintFlags": [ "-E", "dogsled", "-E", "gochecknoglobals"],应用于package mainfunc s(i int) (int, int, int, int, int) { return -1, -2, -3, -4, -5}func fpl() {}var i = 0func main() { _, _, _, _, _ = s(i)}将导致:...>Finished running tool: /Users/0_o/go/bin/golangci-lint run -E dogsled -E gochecknoglobals --print-issued-lines=false --out-format=colored-line-number --issues-exit-code=0.../main.go:7:6 `fpl` is unused (deadcode).../main.go:13:2 declaration has 5 blank identifiers (dogsled).../main.go:10:5 `i` is a global variable (gochecknoglobals)