1
0

add go support

This commit is contained in:
2025-07-15 17:15:49 +02:00
parent ff9efcca0d
commit eaea388f20
7 changed files with 34 additions and 1 deletions

View File

@@ -0,0 +1,22 @@
return {
cmd = { "gopls" },
root_markers = { "go.mod" },
filetypes = { "go", "golang" },
settings = {
gopls = {
completeUnimported = true,
usePlaceholders = true,
analyses = {
unusedparams = true,
},
["ui.inlayhint.hints"] = {
compositeLiteralFields = true,
constantValues = true,
parameterNames = true,
assignVariableTypes = true,
functionTypeParameters = true,
rangeVariableTypes = true,
},
},
},
}

View File

@@ -3,6 +3,7 @@
vim.lsp.enable("luals")
vim.lsp.enable("rust")
vim.lsp.enable("gopls")
vim.lsp.enable("bashls")
vim.lsp.enable("terraform")

View File

@@ -100,6 +100,8 @@ return {
sh = { "shfmt" },
-- brew install ruff
python = { "ruff" },
-- go install mvdan.cc/gofumpt@latest
go = { "gofumpt" },
},
formatters = {
prettier = {

View File

@@ -11,6 +11,8 @@ return {
sh = { "shellcheck" },
-- brew install tflint
terraform = { "tflint" },
-- go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.64.0
go = { "golangcilint" },
}
local lint_augroup = vim.api.nvim_create_augroup("lint", { clear = true })