Closed vegerot closed 1 month ago
The diagnostics come from
null_ls = {
golangci_lint = {
-- disable = {'errcheck', 'staticcheck'}, -- linters to disable empty by default
-- enable = {'govet', 'ineffassign','revive', 'gosimple'}, -- linters to enable; empty by default
},
},
lsp_cfg
. Please check go/lsp.lua@ray-x thank you! Do I need null_ls
to configure it? This is my current config https://github.com/vegerot/dotfiles/blob/c69dd185b82ca955d99d556eea76472059a49add/.config/nvim/init.vim#L257-L296
no, if you did not install null-ls, that means golangci-lint was not used as lsp diagnostics source.
You can change lsp_cfg
the default setting is :
https://github.com/ray-x/go.nvim/blob/e66c3240d26936428cd0f320dc5ffa1eb01538b8/lua/go/gopls.lua#L346-L362
Thank you! I'm silly, I thought the diagnostic was coming from revive
but it was coming from ST1003
. tysm 🙂
Fixed in https://github.com/vegerot/dotfiles/commit/b9d503612aa79ecc2cb2a4ad9532645f3b820b5e
On my system, I only have a few
golangci-lint
linters selected:and when I run
golangci-lint run myfile.go
I do not get any errors.However, when I open
myfile.go
in nvim I getIt looks like this diagnostic is coming from
revive
, which isn't enabled when I rungolangci-lint
from the command line.Question: how do I make
go.nvim
use only the linters I have configured forgolangci-lint
by default, or at least disablerevive
?