dotfiles/.config/nvim/lua/plugins/go.lua

27 lines
622 B
Lua
Raw Normal View History

2024-09-19 08:51:04 +00:00
local lspconfig = require("lspconfig")
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-langserver",
"run",
"--enable-all",
"--disable",
"lll",
"--out-format",
"json",
"--issues-exit-code=1",
},
},
},
}
end
lspconfig.golangci_lint_ls.setup({
filetypes = { "go", "gomod" },
})