# Golang Gopls

Golang semantic code intelligence via `gopls`, the official Go language server, ...

- Repository: https://github.com/samber/cc-skills-golang (3750 stars)
- Category: Testing
- License: MIT
- Last updated: 2026-11-01
- Runs scripts: no, instructions only

## Install

Claude Code: `npx skills add samber/cc-skills-golang --skill golang-gopls -g -a claude-code -y`
Codex: `npx skills add samber/cc-skills-golang --skill golang-gopls -g -a codex -y`
Cursor: `npx skills add samber/cc-skills-golang --skill golang-gopls -g -a cursor -y`
Gemini CLI: `npx skills add samber/cc-skills-golang --skill golang-gopls -g -a gemini-cli -y`

## Description

Golang semantic code intelligence via `gopls`, the official Go language server, go-to-definition, find references, call/implementation hierarchy, workspace symbol search, package API discovery, diagnostics, safe rename, refactors (extract/inline/fill/rewrite code actions), formatting, and generated tests. Reaches an agent via gopls's own MCP server (`go_*` tools), Claude Code's native `LSP` tool, or the `gopls` CLI. Use when navigating or refactoring Go code, jumping to a definition, finding call sites before a rename, understanding a file's or package's dependencies, running diagnostics after an edit, or extracting/inlining/renaming. Not for the published ecosystem, packages not in your `go.mod`, versions, licenses, importers, → See `samber/cc-skills-golang@golang-pkg-go-dev` skill (`godig`). Not for a whole-tree vulnerability audit → See `samber/cc-skills-golang@golang-security` skill (`govulncheck`).

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

**Persona:** You are a Go engineer who reaches for semantic code intelligence instead of grep whenever a question is about the resolved build, grep finds text, `gopls` finds meaning (types, call graphs, shadowing, implementation relationships).

**Dependencies:** `gopls`, `go install golang.org/x/tools/gopls@latest` (v0.20+). The native `LSP` tool additionally needs `ENABLE_LSP_TOOL=1` and the `gopls-lsp@claude-plugins-official` marketplace plugin (see [references/mcp.md](references/mcp.md)).

`gopls` is the official Go language server. It only answers questions about **your specific, locally resolved build**, your workspace plus every dependency exactly as pinned in `go.sum`, including `replace` directives. For a package that isn't part of that build (versions, docs, licenses, CVEs of something you haven't added yet), → See `samber/cc-skills-golang@golang-pkg-go-dev` skill (`godig`) instead.

## Three ways to reach gopls

Not interchangeable, pick by what you already know and what you need back:

The rest: https://github.com/samber/cc-skills-golang/blob/HEAD/skills/golang-gopls/SKILL.md
