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

@@ -44,6 +44,7 @@ dotfiles/
### Development Tools ### Development Tools
- [Rust](https://www.rust-lang.org/) toolchain (including rust-analyzer) - [Rust](https://www.rust-lang.org/) toolchain (including rust-analyzer)
- [Go](https://go.dev/)
- [Neovim](https://neovim.io/) - [Neovim](https://neovim.io/)
- [tmux](https://github.com/tmux/tmux) + - [tmux](https://github.com/tmux/tmux) +
[tmux-plugin-manager](https://github.com/tmux-plugins/tpm) [tmux-plugin-manager](https://github.com/tmux-plugins/tpm)
@@ -60,6 +61,7 @@ dotfiles/
- Shell: shfmt, shellcheck, bash-language-server - Shell: shfmt, shellcheck, bash-language-server
- Terraform: terraform-ls, tflint - Terraform: terraform-ls, tflint
- Python: ruff - Python: ruff
- Go: gopls, golangci-lint (v1.64), gofumpt
### Extras ### Extras
@@ -153,6 +155,7 @@ chsh -s /bin/zsh
``` ```
4. **Set up tmux plugins**: 4. **Set up tmux plugins**:
- Start a tmux session - Start a tmux session
- Press `C-b I` to install plugins - Press `C-b I` to install plugins

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("luals")
vim.lsp.enable("rust") vim.lsp.enable("rust")
vim.lsp.enable("gopls")
vim.lsp.enable("bashls") vim.lsp.enable("bashls")
vim.lsp.enable("terraform") vim.lsp.enable("terraform")

View File

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

View File

@@ -11,6 +11,8 @@ return {
sh = { "shellcheck" }, sh = { "shellcheck" },
-- brew install tflint -- brew install tflint
terraform = { "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 }) local lint_augroup = vim.api.nvim_create_augroup("lint", { clear = true })

View File

@@ -1,4 +1,5 @@
export PATH=~/.local/bin:$PATH export PATH=~/.local/bin:$PATH
export PATH="$(go env GOPATH)/bin:$PATH"
export PATH=$DOTFILES/scripts/hcf/:$PATH export PATH=$DOTFILES/scripts/hcf/:$PATH
case "$(uname -s)" in case "$(uname -s)" in

View File

@@ -18,6 +18,8 @@ export MANPAGER='nvim +Man!'
export SSH_ENV="$HOME/.ssh/agent-environment" export SSH_ENV="$HOME/.ssh/agent-environment"
export GOPRIVATE=gitlab.company.com export GOPRIVATE="gitlab.feedzai.com,git.hcf.zone"
. "$HOME/.cargo/env" . "$HOME/.cargo/env"
export PATH