Important
This pack has moved to
codersauce/red-language-packs.
This repository is archived for history and existing clone URLs. Install the
maintained release with red plugin install --catalog go-language.
The official Go language pack for the Red editor.
It provides Tree-sitter syntax highlighting, Go module and workspace detection, four-column indentation, line comments, and gopls support for hover, completion, go-to-definition, diagnostics, symbols, formatting, and inlay hints.
- Red with external language-package support.
- Git, a C compiler, and the Tree-sitter CLI.
- A Go toolchain and gopls for language-server features; syntax highlighting works without either.
On macOS:
brew install tree-sitter
go install golang.org/x/tools/gopls@latestMake sure the installed gopls executable is available on your PATH.
Build the pinned Go grammar and install this checkout as an external Red package:
cd ~/code/red-go-language-pack
sh build-grammar.sh
red plugin install --path . --trust-native-grammarsWhile language-package support lives on a separate Red worktree, use that binary explicitly:
~/code/red.fcoury-extensible-languages/target/debug/red \
plugin install --path ~/code/red-go-language-pack --trust-native-grammarsThe trust flag approves this exact locally built parser. Rebuilding or changing the parser requires approving the new digest. To approve it separately:
red plugin install --path .
red language trust goIf Red is already running, reload its language definitions:
:languages reloadOpen the included Go module:
red example/main.goPlace the cursor on FriendlyGreeter and press K for hover documentation, or press g d to jump to its definition. The example also exercises interfaces, generic functions, methods, struct fields, context cancellation, channels, strings, and built-in functions.
Run it independently:
cd example
go run .
go test ./...If Go is installed with mise but not enabled globally, activate the installed version for one command:
mise exec go@1.26.3 -- go -C example run .Any existing Go source file works as well. gopls selects the nearest go.work, go.mod, or Git repository as its workspace root.
The build uses tree-sitter/tree-sitter-go release v0.25.0, pinned to commit 1547678a9da59885853f5f5cc8a99cc203fa2e2c. Highlight queries are adapted from the upstream MIT-licensed queries; see THIRD_PARTY_NOTICES.md.