add go support
This commit is contained in:
@@ -44,6 +44,7 @@ dotfiles/
|
||||
### Development Tools
|
||||
|
||||
- [Rust](https://www.rust-lang.org/) toolchain (including rust-analyzer)
|
||||
- [Go](https://go.dev/)
|
||||
- [Neovim](https://neovim.io/)
|
||||
- [tmux](https://github.com/tmux/tmux) +
|
||||
[tmux-plugin-manager](https://github.com/tmux-plugins/tpm)
|
||||
@@ -60,6 +61,7 @@ dotfiles/
|
||||
- Shell: shfmt, shellcheck, bash-language-server
|
||||
- Terraform: terraform-ls, tflint
|
||||
- Python: ruff
|
||||
- Go: gopls, golangci-lint (v1.64), gofumpt
|
||||
|
||||
### Extras
|
||||
|
||||
@@ -153,6 +155,7 @@ chsh -s /bin/zsh
|
||||
```
|
||||
|
||||
4. **Set up tmux plugins**:
|
||||
|
||||
- Start a tmux session
|
||||
- Press `C-b I` to install plugins
|
||||
|
||||
|
||||
22
nvim/.config/nvim/lsp/gopls.lua
Normal file
22
nvim/.config/nvim/lsp/gopls.lua
Normal 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,
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -3,6 +3,7 @@
|
||||
|
||||
vim.lsp.enable("luals")
|
||||
vim.lsp.enable("rust")
|
||||
vim.lsp.enable("gopls")
|
||||
vim.lsp.enable("bashls")
|
||||
vim.lsp.enable("terraform")
|
||||
|
||||
|
||||
@@ -100,6 +100,8 @@ return {
|
||||
sh = { "shfmt" },
|
||||
-- brew install ruff
|
||||
python = { "ruff" },
|
||||
-- go install mvdan.cc/gofumpt@latest
|
||||
go = { "gofumpt" },
|
||||
},
|
||||
formatters = {
|
||||
prettier = {
|
||||
|
||||
@@ -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 })
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
export PATH=~/.local/bin:$PATH
|
||||
export PATH="$(go env GOPATH)/bin:$PATH"
|
||||
export PATH=$DOTFILES/scripts/hcf/:$PATH
|
||||
|
||||
case "$(uname -s)" in
|
||||
|
||||
@@ -18,6 +18,8 @@ export MANPAGER='nvim +Man!'
|
||||
|
||||
export SSH_ENV="$HOME/.ssh/agent-environment"
|
||||
|
||||
export GOPRIVATE=gitlab.company.com
|
||||
export GOPRIVATE="gitlab.feedzai.com,git.hcf.zone"
|
||||
|
||||
. "$HOME/.cargo/env"
|
||||
|
||||
export PATH
|
||||
|
||||
Reference in New Issue
Block a user