Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Provides semantic Go code navigation, refactoring, and diagnostics through the gopls language server's MCP tools, LSP tool, or CLI.
70% 87%+17 ptsof test cases passed
Passed 20 of 23 test cases with the skill, and 16 of 23 without it.
3 of 3 safety checks passed
Not used yet
Source: tip.golang.org/gopls/settings. Settings are passed via the LSP client's initializationOptions (editor-specific config file/UI) — there is no gopls.json read from the workspace by default. Full canonical list: gopls api-json. Store the settings in CLAUDE.md.
| Setting | Type | Default | Purpose |
|---|---|---|---|
buildFlags | []string | [] | Extra flags for the build system, most commonly -tags=<tag> to bring build-tagged files into scope |
env | map[string]string | {} | Environment variables for external commands gopls shells out to (go list, etc.) |
directoryFilters | []string | ["-**/node_modules"] | Include/exclude workspace directories from loading and from workspace-symbol search, using +/- prefixed glob patterns |
expandWorkspaceToModule | bool | true | Whether the enclosing module (not just the opened directory) counts as "workspace" for diagnostics scope |
templateExtensions | []string | [] | File extensions treated as Go template files (templates have no canonical extension, so this is empty by default) |
When it matters: a symbol behind a build tag (//go:build integration) is invisible to references/go_search until buildFlags: ["-tags=integration"] is set — this is the same root cause as the References build-configuration scoping gotcha in features.md.
| Setting | Type | Default | Purpose |
|---|---|---|---|
local | string | "" | Import path prefix treated as "local" for import grouping/sort order — equivalent to goimports -local |
gofumpt | bool | false | Format with mvdan.cc/gofumpt's stricter ruleset instead of plain gofmt |
| Setting | Type | Default | Purpose |
|---|---|---|---|
analyses | map[string]bool | {} | Enable/disable individual analyzers by name (the go vet-based framework plus gopls's own) |
staticcheck | bool | false | Enable the staticcheck.io analyzer suite in addition to the built-in analyzers |
vulncheck | enum: Off|Imports|Prompt | "Prompt" (or "Off" in some client defaults) | Whether/how vulnerability-driven diagnostics on go.mod run |
diagnosticsDelay | time.Duration | "1s" | Idle time after an edit before workspace-wide analysis diagnostics recompute (open-file compile errors update sooner regardless) |
Next to this one in the catalogue, plus more from the same author.