Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
cxuu avatar

Go Naming

  • 925 installs
  • 137 repo stars
  • Updated June 20, 2026
  • cxuu/golang-skills

go-naming is a Go lint skill that automatically catches non-idiomatic identifier names across Go packages, types, functions, and constants before code review or commit.

About

go-naming is an Apache-2.0 cxuu/golang-skills checker grounded in Google and Uber Go style guides for packages, types, functions, methods, variables, constants, and receivers. It ships scripts/check-naming.sh, runnable via allowed Bash tooling, to flag SCREAMING_SNAKE_CASE constants, Get-prefixed getters, vague package names like util or helper, and receiver naming issues. Developers invoke go-naming when creating exported APIs or reviewing naming consistency without waiting for reviewer feedback. The skill complements go-packages for organization topics it explicitly does not cover.

  • Runs scripts/check-naming.sh to detect SCREAMING_SNAKE_CASE, Get- getters, util/helper packages, and this/self receivers
  • Applies to packages, types, functions, methods, variables, constants, and receivers
  • Enforces Google and Uber Go style guide conventions
  • Triggers automatically when creating new types, packages, or exported APIs
  • 5-step naming decision flow for packages, interfaces, receivers, constants, and exported functions

Go Naming by the numbers

  • 925 all-time installs (skills.sh)
  • +39 installs in the week ending Aug 5, 2026 (Skillselion tracking)
  • Ranked #148 of 1,352 Code Review & Quality skills by installs in the Skillselion catalog
  • Security screen: LOW risk (skills.sh audit)
  • Data as of Aug 5, 2026 (Skillselion catalog sync)
npx skills add https://github.com/cxuu/golang-skills --skill go-naming

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs925
repo stars137
Security audit3 / 3 scanners passed
Last updatedJune 20, 2026
Repositorycxuu/golang-skills

How do you lint Go naming conventions automatically?

Automatically catch non-idiomatic Go names across packages, types, functions, and constants before code review or commit.

Who is it for?

Go developers creating exported APIs or large packages who want automated naming checks aligned with Google and Uber style guides before review.

Skip if: Teams needing package layout or module structure guidance, which go-naming defers to the separate go-packages skill.

When should I use this skill?

The user names Go identifiers, creates new exported types or packages, or asks to check Go naming conventions before commit or review.

What you get

A naming scan report listing SCREAMING_SNAKE_CASE, Get-prefix, util package, and receiver anti-patterns in Go code.

  • Naming anti-pattern scan report
  • Pre-review naming fix list

Files

SKILL.mdMarkdownGitHub ↗

Go Naming Conventions

Available Scripts

  • `scripts/check-naming.sh` — Scans Go code for naming anti-patterns: SCREAMING_SNAKE_CASE constants, Get-prefixed getters, bad package names (util/helper/common), and receivers named "this"/"self". Run bash scripts/check-naming.sh --help for options.

Core Principle

Names should:

  • Not feel repetitive when used
  • Take context into consideration
  • Not repeat concepts that are already clear

Naming is more art than science—Go names tend to be shorter than in other languages.

---

Naming Decision Flow

What are you naming?
├─ Package       → Short, lowercase, singular noun (no underscores, no mixedCaps)
├─ Interface     → Method name + "-er" suffix when single-method (Reader, Writer)
├─ Receiver      → 1-2 letter abbreviation of type (c for Client); consistent across methods
├─ Constant      → MixedCaps; use iota for enums; no ALL_CAPS
├─ Exported func → Verb or verb-phrase in MixedCaps; no Get prefix for getters
├─ Variable      → Length proportional to scope distance
│                  ├─ Tiny scope (1-7 lines) → single letter (i, n, r)
│                  ├─ Medium scope           → short word (count, buf)
│                  └─ Package-level / wide   → descriptive (userAccountCount)
└─ Any name      → Check: does it repeat package name or context? If yes, shorten it

---

MixedCaps (Required)

Normative: All Go identifiers must use MixedCaps.

Underscores are allowed only in: test functions (TestFoo_InvalidInput), generated code, and OS/cgo interop.

---

Package Names

Normative: Packages must be lowercase with no underscores.

Short, lowercase, singular nouns. Avoid generic names like util, common, helper — prefer specific names: stringutil, httpauth, configloader.

// Good: user, oauth2, tabwriter
// Bad:  user_service, UserService, count (shadows var)
Read references/IDENTIFIERS.md when naming packages, deciding on import aliases, or choosing between generic and specific package names.

---

Interface Names

Advisory: One-method interfaces use "-er" suffix.

Name one-method interfaces by the method plus -er: Reader, Writer, Formatter. Honor canonical method names (Read, Write, Close, String) and their signatures.

Read references/IDENTIFIERS.md when defining new interfaces or implementing well-known method signatures.

---

Receiver Names

Normative: Receivers must be short abbreviations, used consistently.

One or two letters abbreviating the type, consistent across all methods: func (c *Client) Connect(), func (c *Client) Send(). Never use this or self.

Read references/IDENTIFIERS.md when choosing receiver names or ensuring consistency across methods.

---

Constant Names

Normative: Constants use MixedCaps, never ALL_CAPS or K prefix.

Name constants by role, not value: MaxRetries not Three, DefaultPort not Port8080.

const MaxPacketSize = 512
const defaultTimeout = 30 * time.Second
Read references/IDENTIFIERS.md when naming constants or choosing between role-based and value-based names.

---

Initialisms and Acronyms

Normative: Initialisms maintain consistent case throughout.

Initialisms (URL, ID, HTTP, API) must be all uppercase or all lowercase: HTTPClient, userID, ParseURL() — not HttpClient, orderId, ParseUrl().

Read references/IDENTIFIERS.md when using initialisms in compound names or for the full case table.

---

Function and Method Names

Advisory: No Get prefix for simple accessors; use verb-like names for actions.

Getter for field owner is Owner(), not GetOwner(). Setter is SetOwner(). Use Compute or Fetch for expensive operations.

When functions differ only by type, include type at the end: ParseInt(), ParseInt64().

Read references/IDENTIFIERS.md when designing getter/setter APIs or naming function variants.

---

Variable Names

Variable naming balances brevity with clarity. Key principles:

  • Scope-based length: Short names (i, v) for small scopes; longer,

descriptive names for larger scopes

  • Single-letter conventions: Use familiar patterns (i for index,

r/w for reader/writer)

  • Avoid type in name: Use users not userSlice, name not nameString
  • Prefix unexported globals: Use _ prefix for package-level unexported

vars/consts to prevent shadowing

for i, v := range items { ... }           // small scope
pendingOrders := filterPending(orders)    // larger scope
const _defaultPort = 8080                 // unexported global
Read references/VARIABLES.md when naming local variables in functions over 15 lines.

---

Avoiding Repetition

Go names should not feel repetitive when used. Consider the full context:

  • Package + symbol: widget.New() not widget.NewWidget()
  • Receiver + method: p.Name() not p.ProjectName()
  • Context + type: In package sqldb, use Connection not DBConnection
Read references/REPETITION.md when a package name and its exported symbols feel redundant.

---

Avoid Built-In Names

Never shadow Go's predeclared identifiers (error, string, len, cap, append, copy, new, make, etc.) as variable, parameter, or type names.

For detailed guidance: See go-declarations — "Avoid Using Built-In Names" section.

---

Quick Reference

ElementRuleExample
Packagelowercase, no underscorespackage httputil
ExportedMixedCaps, starts uppercasefunc ParseURL()
UnexportedmixedCaps, starts lowercasefunc parseURL()
Receiver1-2 letter abbreviationfunc (c *Client)
ConstantMixedCaps, never ALL_CAPSconst MaxSize = 100
Initialismconsistent caseuserID, XMLAPI
Variablelength ~ scope sizei (small), userCount (large)
Built-in namesNever shadow predeclared identifiersSee go-declarations
Validation: After renaming identifiers, run bash scripts/check-naming.sh to verify no naming anti-patterns remain. Then run go build ./... to confirm the rename didn't break anything.

Related Skills

  • Interface naming: See go-interfaces when naming interfaces with the -er suffix or choosing receiver types
  • Package naming: See go-packages when naming packages, avoiding util/common, or resolving import collisions
  • Error naming: See go-error-handling when naming sentinel errors (ErrFoo) or custom error types
  • Declaration scope: See go-declarations when variable name length depends on scope or when avoiding built-in shadowing
  • Style principles: See go-style-core when balancing clarity vs concision in identifier names

Related skills

FAQ

What does go-naming scripts/check-naming.sh detect?

go-naming scripts/check-naming.sh scans Go code for SCREAMING_SNAKE_CASE constants, Get-prefixed getters, vague util or helper package names, and receiver naming anti-patterns aligned with Google and Uber guides.

Does go-naming cover Go package organization?

go-naming focuses on identifier naming for packages, types, functions, methods, variables, constants, and receivers; package organization belongs to the separate go-packages skill.

Is Go Naming safe to install?

skills.sh reports 3 of 3 security scanners passed. Review the Security Audits panel on this page before installing in production.

Code Review & Qualitybackendtesting

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.