Open
Description
Thank you for the bug report
- I am using the latest version of
lsp-mode
related packages.I checked FAQ and Troubleshooting sectionsYou may also try reproduce the issue using clean environment using the following command:M-x lsp-start-plain
Bug description
The flags defined in clients/lsp-golangci-lint.el
are not compatible with v2 of golangci-lint
:
(defun lsp-golangci-lint--get-initialization-options ()
"Return initialization options for golangci-lint-langserver."
(let ((opts (make-hash-table :test 'equal))
(command (vconcat `(,lsp-golangci-lint-path)
["run" "--out-format=json" "--issues-exit-code=1"]
(lsp-golangci-lint--run-args))))
(puthash "command" command opts)
opts))
The flag to output json has changed to --output.json.path=stdout
: golangci/golangci-lint#5612
Steps to reproduce
- upgrade golangcli-lint to v2
- enable the LSP
Expected behavior
It should work
Which Language Server did you use?
golangci-lint
OS
MacOS
Error callstack
There's no error, it reports as a flycheck error
Anything else?
No response
Activity
Z01d-b3rg commentedon May 23, 2025
Had the same issue and was able to fix it by changing the initialization options to the following:
And when using golangci configuration files not located in the repository root, I had to also configure the
relative-path-mode
hiroxy commentedon Jun 17, 2025
This issue has probably been fixed in #4810.