ray-x / go.nvim
git clone https://github.com/ray-x/go.nvim.git
v0.11 Β· 6mo ago
π₯ on GitHub Trending today
G'day Nvimer, Joyful Gopher: Explore the Feature-Packed Go Plugin for Neovim
+0
stars, 24h Β· #664
β
stars, 7 days
β
stars, 30 days
2.7k
β
total
161
forks Β· 98 open issues
Star history starts 2026-10-20; the chart appears after the second daily snapshot.
LanguageLua
LicenseMIT
Created2021-03-10 (5y ago)
Last push2d ago
Watchers11
OwnerUser
Seen on GitHub Trending
- 2026-10-20 β #13 daily in lua
GitHub topics
Links
- GitHub: github.com/ray-x/go.nvim
- Releases Β· Issues Β· Hacker News mentions
README excerpt
# go.nvim A modern go neovim plugin based on treesitter, gopls, dap debugger and AI. It is written in Lua and async as much as possible. PR & Suggestions are welcome. The plugin covers most features required for a gopher. **LSP & Navigation** - gopls commands: fillstruct, organize imports, list modules/packages, gc_details, generate, change signature, etc. - All GoToXxx (reference, implementation, definition, doc, peek code/doc, etc.) via gopls/lspconfig. Check navigator.lua for a floating UI experience - Show interface implementations with virtual text - Inlay hints (gopls 0.9+; enabled by default in 0.10+) - CodeLens & CodeAction support **Build, Test & Coverage** - Async build/make/test with libuv job wrapper - Test with `go test`, gotestsum, or ginkgo β including floaterm support - Generate unit tests with gotests (table-driven, testify) - Test coverage: run coverage, display signs, and show function metrics - Smart build-tag detection for debug/test runs (e.g. `//go:build integration`) **Code Generation & Refactoring** - `GoIfErr`, `GoFillStruct`, `GoFillSwitch`, `GoFixPlurals`, `GoGenReturn` β powered by treesitter/go AST - `GoImpl` β generate interface method stubs - `GoEnum` β generate enum helpers - `GoJson2Struct` β convert JSON/YAML to Go structs - `GoMockGen` β generate mocks with mockgen - `GoNew` β create files/projects from templates (including `gonew`) - GoFix - Run `go fix` - Struct tag management with `gomodifytags` **Formatting & Linting** - Format via LSP (gopls) or CLI (`gofumpt`, `goimports`) - Lint with golangci-lint (v2) β LSP diagnostics or async background checks **Debugging** - Dlv debug with nvim-dap and nvim-dap-ui β zero-config Go adapter included - Load VSCode `launch.json` configurations **AI-Powered** - `GoAI` β natural-language command dispatcher (translates natural-language into go.nvim commands via Copilot/OpenAI). - `GoCmtAI` β generate doc comments with AI for the declaration at cursor - `GoDocAI` β AI-powered documentation: find symbols by vague name and generate rich docs from source - `GoCodeReview` β AI code review for files, selections, or diffs; results populate the quickfix list - `GoAIChat` β ask questions about Go code with AI; auto-includes function context and LSP references **Documentation & Navigation** - `GoDoc` / `GoDocBrowser` β view docs in a float or browser - `GoCheat` β cheat sheets from cheat.sh - `GoAlt` / `GoAltV` / `GoAltS` β switch between test and implementation files - `GoPkgOutline` / `GoPkgSymbols` β package-level symbol outlines **Comments & Docs** - Auto-generate doc comments for packages, functions, structs, and interfaces (suppresses golint warnings) **Module & Workspace** - `GoModTidy`, `GoModVendor`, `GoGet`, `GoWork`, etc. - `Gomvp` β rename/move packages - `GoVulnCheck` β run govulncheck for vulnerability scanning **Syntax & Snippets** - Treesitter-based syntax highlighting and textobjects - Treesitter highlight injection for SQL, JSON, `go template`, and `gohtmltmpl` - F