From go
Go naming conventions and idiomatic identifier choices. Use when writing new Go code, reviewing Go naming decisions, naming packages, types, functions, variables, interfaces, constants, or error values — or when the user asks about Go naming style, MixedCaps, getter/setter naming, receiver names, initialism casing (URL, ID, HTTP), or when they are struggling with what to name something in Go. Covers Effective Go, Google Go Style Guide, and community conventions.
How this skill is triggered — by the user, by Claude, or both
Slash command
/go:namingThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
> Full rationale: [Effective Go](https://go.dev/doc/effective_go) and the
Full rationale: Effective Go and the Google Go Style Guide. This skill keeps only the items models actually slip on plus a checklist — it does not restate the guides.
Initialisms keep uniform case — all caps when exported, all lower when not.
Never title-case them (Url, Id, Http).
| Term | Exported | Unexported | Wrong |
|---|---|---|---|
| URL | URL | url | Url |
| ID | ID | id | Id |
| HTTP | HTTP | http | Http |
| XML API | XMLAPI | xmlAPI | XmlApi |
| gRPC | GRPC | gRPC | Grpc |
| DDoS | DDoS | ddos | DDOS |
| DB | DB | db | Db |
// ✓ Good
func ServeHTTP(w http.ResponseWriter, r *http.Request)
type URLValidator struct{}
var userID string
// ✗ Bad
func ServeHttp(...)
type UrlValidator struct{}
var odpsId string
Get prefix// ✓ Good
owner := obj.Owner()
obj.SetOwner(user)
// ✗ Bad
owner := obj.GetOwner()
Use Compute, Fetch, or List instead of Get when the operation is
expensive, involves I/O, or returns a collection.
Drop the package name from exported identifiers — the caller already qualifies with it.
// ✓ Good
ring.New() // not ring.NewRing()
bytes.Buffer // not bytes.ByteBuffer
http.Get() // not http.HTTPGet()
json.Marshal() // not json.JSONMarshal()
// ✗ Bad
ring.NewRing()
bufio.BufReader
this or selffunc (b *Buffer) Read(p []byte) (n int, err error)
func (r Rectangle) Size() Point
func (sh serverHandler) ServeHTTP(w ResponseWriter, req *Request)
| Avoid | Use |
|---|---|
func (this *ReportWriter) | func (w *ReportWriter) |
func (self *Scanner) | func (s *Scanner) |
func (tray Tray) | func (t Tray) |
func (info *ResearchInfo) | func (ri *ResearchInfo) |
MixedCaps — never underscores (except test names)pkg.New() not pkg.NewPkg()users not userSlicecount not userCount inside UserCount()Get prefix — Owner() not GetOwner()-er suffix for single-method, descriptive for multi-methodthis/selfMixedCaps not ALL_CAPSErrFoo for values, FooError for typesURL/url, ID/id — never Url/Idnpx claudepluginhub nq-rdl/agent-extensions --plugin goGuides creation and editing of skills using test-driven development with pressure scenarios and subagents to verify agent compliance.
Forks private projects, strips secrets/internal references, verifies cleanliness, and packages them with CLAUDE.md, README, and setup.sh for safe public release.