dotfiles/.config/nvim/lua/plugins/go.lua
kekskurse 311a530ff4 nvim
2024-09-19 10:51:04 +02:00

26 lines
622 B
Lua

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" },
})