packages/shared-skills/skills/lsp-setup/references/go/README.md
gopls — gopls.gogo install golang.org/x/tools/gopls@latestgo install golang.org/x/tools/gopls@latest (or brew install gopls)go install golang.org/x/tools/gopls@latestgo install golang.org/x/tools/gopls@latestRequires the Go toolchain. go install drops the binary in $GOPATH/bin
(default ~/go/bin) — that directory must be on PATH.
export PATH="$PATH:$(go env GOPATH)/bin"
Confirm it resolves:
command -v gopls
Builtin — usually NO config needed (auto-resolved by extension). Configure only to set priority, init options, override extensions, or disable. Same JSON shape in .codex/lsp-client.json (Codex) AND .opencode/lsp.json (OpenCode/omo):
{ "lsp": { "gopls": { "priority": 100 } } }
For builtin ids in a PROJECT config, command is supplied automatically — only set priority/initialization/extensions/disabled/env. A fully custom (non-builtin) server with its own command must go in the USER config (~/.codex/lsp-client.json).
None commonly required. To enable extra analyses or staticcheck:
{ "lsp": { "gopls": { "initialization": { "staticcheck": true } } } }
None — gopls is the official and de facto sole Go language server.
gopls must be on PATH; ensure $(go env GOPATH)/bin is exported, then reopen the shell.go.mod as the workspace root. Outside a module, gopls degrades. Run go mod tidy if dependencies are unresolved.go install golang.org/x/tools/gopls@latest after upgrading Go.bun ../../scripts/verify-lsp.ts path/to/file.go