neovim-go-nix-develop
goimports
Our great sponsors
neovim-go-nix-develop | goimports | |
---|---|---|
8 | 46 | |
21 | 7,207 | |
- | 0.7% | |
4.2 | 9.9 | |
5 months ago | 7 days ago | |
Lua | Go | |
MIT License | BSD 3-clause "New" or "Revised" License |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
neovim-go-nix-develop
-
Is there any way to autocomplete language functions? For example, show things like fmt.Printf or fmt.Println when writing fmt.Print and pressing the autocomplete key.
https://github.com/jamespwilliams/neovim-go-nix-develop is a minimal Go neovim dev env I put together a while back (it can be created in one command with Nix, but even if you don’t use/know about Nix, you can read the file and see the config used).
-
SpaceVim Release v2.0.0
https://github.com/jamespwilliams/neovim-go-nix-develop
The above is my attempt to create a minimal Neovim configuration that uses treesitter and nvim-lsp (albeit only for Go).
It uses Nix, so if you have Nix installed you can immediately try the configuration out in a self-contained development shell.
It’s too minimal for everyday use, but could be of inspiration.
-
Set up a Go neovim development environment in one command using Nix
I've updated it to use 1.18: https://github.com/jamespwilliams/neovim-go-nix-develop/commit/6e6e980752bbe50f9eea17dd438729aabfa7ef65
- neovim-go-nix-develop: set up a Go Neovim development environment in one command using Nix
- Show HN: Set up a Go Neovim development environment in one command using Nix
- Show HN: Set up a Golang Neovim development environment in one command using Nix
goimports
- Gopls/v0.15.0
-
How to find all methods which return struct "Foo" (vscode or cli)
Just a guess, but it might be somewhere in gopls https://github.com/golang/tools/tree/master/gopls/doc On this page https://langserver.org/ it says it should support "finding references"
- Major rewrite of gopls released (2 weeks ago)
-
What LSP are y'all using?
Language server protocol. Here’s a good one: https://github.com/golang/tools/blob/master/gopls/README.md
-
Can Someone Explain To Me Like I'm 5
gopls was not able to find modules in your workspace.When outside of GOPATH, gopls needs to know which modules you are working on.You can fix this by opening your workspace to a folder inside a Go module, orby using a go.work file to specify multiple modules.See the documentation for more information on setting up your workspace:https://github.com/golang/tools/blob/master/gopls/doc/workspace.md.
- Latest gopls version still v0.11.0 from December 22?
- GitHub - orijtech/structslop: structslop is a static analyzer for Go that recommends struct field rearrangements to provide for maximum space/allocation efficiency.
-
betteralign - structs field alignment static analyzer for Go
For more gopls settings, you can see files in this folder: https://github.com/golang/tools/tree/master/gopls/doc
-
Linter for explicit hint to interface which gets implemented.
But finding which interface is satisfied by a type is trivial anyways through gopls which integrates conveniently into any LSP supporting IDE (such as VSCode and Goland).
-
Setting up helix for golang
You need to make sure you have Google's lsp server for golang installed.
What are some alternatives?
mason.nvim - Portable package manager for Neovim that runs everywhere Neovim runs. Easily install and manage LSP servers, DAP servers, linters, and formatters.
gofumpt - A stricter gofmt
lsp-zero.nvim - A starting point to setup some lsp related features in neovim.
nvim-lspconfig - Quickstart configs for Nvim LSP
NvChad - Blazing fast Neovim config providing solid defaults and a beautiful UI, enhancing your neovim experience.
goreturns - A gofmt/goimports-like tool for Go programmers that fills in Go return statements with zero values to match the func return types
GoLint - [mirror] This is a linter for Go source code. (deprecated)
staticcheck
golines - A golang formatter that fixes long lines
go-checkstyle - checkstyle for go
Go Metalinter
GoCover.io - GoCover.io offers the code coverage of any golang package as a service.