2

I'm trying to integrate golangci-lint with vscode. This is my settings file in vscode

  "go.lintTool": "golangci-lint",
  "go.lintFlags": ["--fast"],
  "go.liveErrors": {
    "enabled": true,
    "delay": 500
  },
  "go.lintOnSave": "workspace",
  "editor.codeActionsOnSave": {
    "source.organizeImports": true
  },
  "go.useLanguageServer": true,
  "go.languageServerExperimentalFeatures": {
    "diagnostics": true
  }

However none of the errors/warnings show up on vscode. Initially it was showing up but suddenly disappeared. Also on another note, I know the linting tool in turn use a number of other linters like errcheck ineffassign and so on, do I have to install them separately ?

1 Answer 1

4

I had a similar problem and I solved it by removing --fast flag from the configuration, and rerunning linter via VS Code plugin, then adding it back.

I suspect it had something to do with the cache the --fast flag is using: https://golangci-lint.run/usage/faq/#why-running-with---fast-is-slow-on-the-first-run

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.