feats: golang linting for nvim
This commit is contained in:
parent
9418d06cdb
commit
c35040650c
|
@ -146,3 +146,21 @@ end
|
|||
-- },
|
||||
-- })
|
||||
-- end
|
||||
|
||||
-- golangci
|
||||
local configs = require 'lspconfig/configs'
|
||||
if not configs.golangcilsp then
|
||||
configs.golangcilsp = {
|
||||
default_config = {
|
||||
cmd = { 'golangci-lint-langserver' },
|
||||
root_dir = lspconfig.util.root_pattern('.git', 'go.mod'),
|
||||
init_options = {
|
||||
command = { "golangci-lint", "run", "--out-format", "json",
|
||||
"--issues-exit-code=1" };
|
||||
}
|
||||
};
|
||||
}
|
||||
end
|
||||
lspconfig.golangci_lint_ls.setup {
|
||||
filetypes = { 'go', 'gomod' }
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user