[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6JZCXBFYKM5A7W8QHBG5SP6":3,"skill-same:01M6JZCXBFYKM5A7W8QHBG5SP6":101},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":39,"linkOnly":40,"markdownContent":41,"markdownBody":42,"frontMatter":43,"refName":56,"commitSha":57,"skillDirectory":58,"forksCount":14,"repositoryHtmlUrl":50,"repositoryHomepageUrl":6,"ownerHtmlUrl":59,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":60,"install":61,"resources":74},"01M6JZCXBFYKM5A7W8QHBG5SP6","golang-naming",null,"Go (Golang) naming conventions — covers packages, constructors, structs, interfaces, constants, enums, errors, booleans, receivers, getters\u002Fsetters, functional options, acronyms, test functions, and subtest names. Use this skill when writing new Go code, reviewing or refactoring, choosing between naming alternatives (New vs NewTypeName, isConnected vs connected, ErrNotFound vs NotFoundError, StatusReady vs StatusUnknown at iota 0), debating Go package names (utils\u002Fhelpers anti-patterns), or asking about Go naming best practices. Also trigger when the user mentions MixedCaps vs snake_case, ALL_CAPS constants, Get-prefix on getters, or error string casing. Do NOT use for general Go implementation questions that don't involve naming decisions.","paulohgodinho\u002Fskills","paulohgodinho","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F57510522?v=4","01M6JZBW2QZR573QTV4PN1H6DE","Paulo Godinho","01M6JZBW6QM55GHQB0K3BC6D45",0,"MIT","https:\u002F\u002Fgithub.com\u002Fpaulohgodinho\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fgo\u002Fgolang-naming\u002FSKILL.md",[],[19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38],"golang","naming","golang naming","at","writing","utils","errors","functional","error","false","get","options","anti-patterns","read","projects","refactoring","Bash","code","packages","ai coding agents","2026-11-10 10:12:30",false,"---\nname: golang-naming\ndescription: \"Go (Golang) naming conventions — covers packages, constructors, structs, interfaces, constants, enums, errors, booleans, receivers, getters\u002Fsetters, functional options, acronyms, test functions, and subtest names. Use this skill when writing new Go code, reviewing or refactoring, choosing between naming alternatives (New vs NewTypeName, isConnected vs connected, ErrNotFound vs NotFoundError, StatusReady vs StatusUnknown at iota 0), debating Go package names (utils\u002Fhelpers anti-patterns), or asking about Go naming best practices. Also trigger when the user mentions MixedCaps vs snake_case, ALL_CAPS constants, Get-prefix on getters, or error string casing. Do NOT use for general Go implementation questions that don't involve naming decisions.\"\nuser-invocable: false\nlicense: MIT\ncompatibility: Designed for Claude Code or similar AI coding agents, and for projects using Golang.\nmetadata:\n  author: samber\n  version: \"1.0\"\n  openclaw:\n    emoji: \"?️\"\n    homepage: https:\u002F\u002Fgithub.com\u002Fpaulohgodinho\u002Fskills\n    requires:\n      bins:\n        - go\n    install: []\nallowed-tools: Read Edit Write Glob Grep Bash(go:*) Bash(golangci-lint:*) Bash(git:*) Agent\n---\n\n> **Community default.** A company skill that explicitly supersedes `samber\u002Fcc-skills-golang@golang-naming` skill takes precedence.\n\n# Go Naming Conventions\n\nGo favors short, readable names. Capitalization controls visibility — uppercase is exported, lowercase is unexported. All identifiers MUST use MixedCaps, NEVER underscores.\n\n> \"Clear is better than clever.\" — Go Proverbs\n>\n> \"Design the architecture, name the components, document the details.\" — Go Proverbs\n\nTo ignore a rule, just add a comment to the code.\n\n## Quick Reference\n\n| Element | Convention | Example |\n| --- | --- | --- |\n| Package | lowercase, single word | `json`, `http`, `tabwriter` |\n| File | lowercase, underscores OK | `user_handler.go` |\n| Exported name | UpperCamelCase | `ReadAll`, `HTTPClient` |\n| Unexported | lowerCamelCase | `parseToken`, `userCount` |\n| Interface | method name + `-er` | `Reader`, `Closer`, `Stringer` |\n| Struct | MixedCaps noun | `Request`, `FileHeader` |\n| Constant | MixedCaps (not ALL_CAPS) | `MaxRetries`, `defaultTimeout` |\n| Receiver | 1-2 letter abbreviation | `func (s *Server)`, `func (b *Buffer)` |\n| Error variable | `Err` prefix | `ErrNotFound`, `ErrTimeout` |\n| Error type | `Error` suffix | `PathError`, `SyntaxError` |\n| Constructor | `New` (single type) or `NewTypeName` (multi-type) | `ring.New`, `http.NewRequest` |\n| Boolean field | `is`, `has`, `can` prefix on **fields** and methods | `isReady`, `IsConnected()` |\n| Test function | `Test` + function name | `TestParseToken` |\n| Acronym | all caps or all lower | `URL`, `HTTPServer`, `xmlParser` |\n| Variant: context | `WithContext` suffix | `FetchWithContext`, `QueryContext` |\n| Variant: in-place | `In` suffix | `SortIn()`, `ReverseIn()` |\n| Variant: error | `Must` prefix | `MustParse()`, `MustLoadConfig()` |\n| Option func | `With` + field name | `WithPort()`, `WithLogger()` |\n| Enum (iota) | type name prefix, zero-value = unknown | `StatusUnknown` at 0, `StatusReady` |\n| Named return | descriptive, for docs only | `(n int, err error)` |\n| Error string | lowercase (incl. acronyms), no punctuation | `\"image: unknown format\"`, `\"invalid id\"` |\n| Import alias | short, only on collision | `mrand \"math\u002Frand\"`, `pb \"app\u002Fproto\"` |\n| Format func | `f` suffix | `Errorf`, `Wrapf`, `Logf` |\n| Test table fields | `got`\u002F`expected` prefixes | `input string`, `expected int` |\n\n## MixedCaps\n\nAll Go identifiers MUST use `MixedCaps` (or `mixedCaps`). NEVER use underscores in identifiers — the only exceptions are test function subcases (`TestFoo_InvalidInput`), generated code, and OS\u002Fcgo interop. This is load-bearing, not cosmetic — Go's export mechanism relies on capitalization, and tooling assumes MixedCaps throughout.\n\n```go\n\u002F\u002F ✓ Good\nMaxPacketSize\nuserCount\nparseHTTPResponse\n\n\u002F\u002F ✗ Bad — these conventions conflict with Go's export mechanism and tooling expectations\nMAX_PACKET_SIZE   \u002F\u002F C\u002FPython style\nmax_packet_size   \u002F\u002F snake_case\nkMaxBufferSize    \u002F\u002F Hungarian notation\n```\n\n## Avoid Stuttering\n\nGo call sites always include the package name, so repeating it in the identifier wastes the reader's time — `http.HTTPClient` forces parsing \"HTTP\" twice. A name MUST NOT repeat information already present in the package name, type name, or surrounding context.\n\n```go\n\u002F\u002F Good — clean at the call site\nhttp.Client       \u002F\u002F not http.HTTPClient\njson.Decoder      \u002F\u002F not json.JSONDecoder\nuser.New()        \u002F\u002F not user.NewUser()\nconfig.Parse()    \u002F\u002F not config.ParseConfig()\n\n\u002F\u002F In package sqldb:\ntype Connection struct{}  \u002F\u002F not DBConnection — \"db\" is already in the package name\n\n\u002F\u002F Anti-stutter applies to ALL exported types, not just the primary struct:\n\u002F\u002F In package dbpool:\ntype Pool struct{}        \u002F\u002F not DBPool\ntype Status struct{}      \u002F\u002F not PoolStatus — callers write dbpool.Status\ntype Option func(*Pool)   \u002F\u002F not PoolOption\n```\n\n## Frequently Missed Conventions\n\nThese conventions are correct but non-obvious — they are the most common source of naming mistakes:\n\n**Constructor naming:** When a package exports a single primary type, the constructor is `New()`, not `NewTypeName()`. This avoids stuttering — callers write `apiclient.New()` not `apiclient.NewClient()`. Use `NewTypeName()` only when a package has multiple constructible types (like `http.NewRequest`, `http.NewServeMux`).\n\n**Boolean struct fields:** Unexported boolean fields MUST use `is`\u002F`has`\u002F`can` prefix — `isConnected`, `hasPermission`, not bare `connected` or `permission`. The exported getter keeps the prefix: `IsConnected() bool`. This reads naturally as a question and distinguishes booleans from other types.\n\n**Error strings are fully lowercase — including acronyms.** Write `\"invalid message id\"` not `\"invalid message ID\"`, because error strings are often concatenated with other context (`fmt.Errorf(\"parsing token: %w\", err)`) and mixed case looks wrong mid-sentence. Sentinel errors should include the package name as prefix: `errors.New(\"apiclient: not found\")`.\n\n**Enum zero values:** Always place an explicit `Unknown`\u002F`Invalid` sentinel at iota position 0. A `var s Status` silently becomes 0 — if that maps to a real state like `StatusReady`, code can behave as if a status was deliberately chosen when it wasn't.\n\n**Subtest names:** Table-driven test case names in `t.Run()` should be fully lowercase descriptive phrases: `\"valid id\"`, `\"empty input\"` — not `\"valid ID\"` or `\"Valid Input\"`.\n\n## Detailed Categories\n\nFor complete rules, examples, and rationale, see:\n\n- **[Packages, Files & Import Aliasing](.\u002Freferences\u002Fpackages-files.md)** — Package naming (single word, lowercase, no plurals), file naming conventions, import alias patterns (only use on collision to avoid cognitive load), and directory structure.\n\n- **[Variables, Booleans, Receivers & Acronyms](.\u002Freferences\u002Fidentifiers.md)** — Scope-based naming (length matches scope: `i` for 3-line loops, longer names for package-level), single-letter receiver conventions (`s` for Server), acronym casing (URL not Url, HTTPServer not HttpServer), and boolean naming patterns (isReady, hasPrefix).\n\n- **[Functions, Methods & Options](.\u002Freferences\u002Ffunctions-methods.md)** — Getter\u002Fsetter patterns (Go omits `Get` so `user.Name()` reads naturally), constructor conventions (`New` or `NewTypeName`), named returns (for documentation only), format function suffixes (`Errorf`, `Wrapf`), and functional options (`WithPort`, `WithLogger`).\n\n- **[Types, Constants & Errors](.\u002Freferences\u002Ftypes-errors.md)** — Interface naming (`Reader`, `Closer` suffix with `-er`), struct naming (nouns, MixedCaps), constants (MixedCaps, not ALL_CAPS), enums (type name prefix like `StatusReady`), sentinel errors (`ErrNotFound` variables), error types (`PathError` suffix), and error message conventions (lowercase, no punctuation).\n\n- **[Test Naming](.\u002Freferences\u002Ftesting.md)** — Test function naming (`TestFunctionName`), table-driven test field conventions (`input`, `expected`), test helper naming, and subcase naming patterns.\n\n## Common Mistakes\n\n| Mistake | Fix |\n| --- | --- |\n| `ALL_CAPS` constants | Go reserves casing for visibility, not emphasis — use `MixedCaps` (`MaxRetries`) |\n| `GetName()` getter | Go omits `Get` because `user.Name()` reads naturally at call sites. But `Is`\u002F`Has`\u002F`Can` prefixes are kept for boolean predicates: `IsHealthy() bool` not `Healthy() bool` |\n| `Url`, `Http`, `Json` acronyms | Mixed-case acronyms create ambiguity (`HttpsUrl` — is it `Https+Url`?). Use all caps or all lower |\n| `this` or `self` receiver | Go methods are called frequently — use 1-2 letter abbreviation (`s` for `Server`) to reduce visual noise |\n| `util`, `helper` packages | These names say nothing about content — use specific names that describe the abstraction |\n| `http.HTTPClient` stuttering | Package name is always present at call site — `http.Client` avoids reading \"HTTP\" twice |\n| `user.NewUser()` constructor | Single primary type uses `New()` — `user.New()` avoids repeating the type name |\n| `connected bool` field | Bare adjective is ambiguous — use `isConnected` so the field reads as a true\u002Ffalse question |\n| `\"invalid message ID\"` error | Error strings must be fully lowercase including acronyms — `\"invalid message id\"` |\n| `StatusReady` at iota 0 | Zero value should be a sentinel — `StatusUnknown` at 0 catches uninitialized values |\n| `\"not found\"` error string | Sentinel errors should include the package name — `\"mypackage: not found\"` identifies the origin |\n| `userSlice` type-in-name | Types encode implementation detail — `users` describes what it holds, not how |\n| Inconsistent receiver names | Switching names across methods of the same type confuses readers — use one name consistently |\n| `snake_case` identifiers | Underscores conflict with Go's MixedCaps convention and tooling expectations — use `mixedCaps` |\n| Long names for short scopes | Name length should match scope — `i` is fine for a 3-line loop, `userIndex` is noise |\n| Naming constants by value | Values change, roles don't — `DefaultPort` survives a port change, `Port8080` doesn't |\n| `FetchCtx()` context variant | `WithContext` is the standard Go suffix — `FetchWithContext()` is instantly recognizable |\n| `sort()` in-place but no `In` | Readers assume functions return new values. `SortIn()` signals mutation |\n| `parse()` panicking on error | `MustParse()` warns callers that failure panics — surprises belong in the name |\n| Mixing `With*`, `Set*`, `Use*` | Consistency across the codebase — `With*` is the Go convention for functional options |\n| Plural package names | Go convention is singular (`net\u002Furl` not `net\u002Furls`) — keeps import paths consistent |\n| `Wrapf` without `f` suffix | The `f` suffix signals format-string semantics — `Wrapf`, `Errorf` tell callers to pass format args |\n| Unnecessary import aliases | Aliases add cognitive load. Only alias on collision — `mrand \"math\u002Frand\"` |\n| Inconsistent concept names | Using `user`\u002F`account`\u002F`person` for the same concept forces readers to track synonyms — pick one name |\n\n## Enforce with Linters\n\nMany naming convention issues are caught automatically by linters: `revive`, `predeclared`, `misspell`, `errname`. See [golang-linter](..\u002Fgolang-linter\u002FSKILL.md) for configuration and usage.\n\n## Cross-References\n\n- → See [golang-code-style](..\u002Fgolang-code-style\u002FSKILL.md) for broader formatting and style decisions\n- → See [golang-structs-interfaces](..\u002Fgolang-structs-interfaces\u002FSKILL.md) for interface naming depth and receiver design\n- → See [golang-linter](..\u002Fgolang-linter\u002FSKILL.md) for automated enforcement (revive, predeclared, misspell, errname)\n","> **Community default.** A company skill that explicitly supersedes `samber\u002Fcc-skills-golang@golang-naming` skill takes precedence.\n\n# Go Naming Conventions\n\nGo favors short, readable names. Capitalization controls visibility — uppercase is exported, lowercase is unexported. All identifiers MUST use MixedCaps, NEVER underscores.\n\n> \"Clear is better than clever.\" — Go Proverbs\n>\n> \"Design the architecture, name the components, document the details.\" — Go Proverbs\n\nTo ignore a rule, just add a comment to the code.\n\n## Quick Reference\n\n| Element | Convention | Example |\n| --- | --- | --- |\n| Package | lowercase, single word | `json`, `http`, `tabwriter` |\n| File | lowercase, underscores OK | `user_handler.go` |\n| Exported name | UpperCamelCase | `ReadAll`, `HTTPClient` |\n| Unexported | lowerCamelCase | `parseToken`, `userCount` |\n| Interface | method name + `-er` | `Reader`, `Closer`, `Stringer` |\n| Struct | MixedCaps noun | `Request`, `FileHeader` |\n| Constant | MixedCaps (not ALL_CAPS) | `MaxRetries`, `defaultTimeout` |\n| Receiver | 1-2 letter abbreviation | `func (s *Server)`, `func (b *Buffer)` |\n| Error variable | `Err` prefix | `ErrNotFound`, `ErrTimeout` |\n| Error type | `Error` suffix | `PathError`, `SyntaxError` |\n| Constructor | `New` (single type) or `NewTypeName` (multi-type) | `ring.New`, `http.NewRequest` |\n| Boolean field | `is`, `has`, `can` prefix on **fields** and methods | `isReady`, `IsConnected()` |\n| Test function | `Test` + function name | `TestParseToken` |\n| Acronym | all caps or all lower | `URL`, `HTTPServer`, `xmlParser` |\n| Variant: context | `WithContext` suffix | `FetchWithContext`, `QueryContext` |\n| Variant: in-place | `In` suffix | `SortIn()`, `ReverseIn()` |\n| Variant: error | `Must` prefix | `MustParse()`, `MustLoadConfig()` |\n| Option func | `With` + field name | `WithPort()`, `WithLogger()` |\n| Enum (iota) | type name prefix, zero-value = unknown | `StatusUnknown` at 0, `StatusReady` |\n| Named return | descriptive, for docs only | `(n int, err error)` |\n| Error string | lowercase (incl. acronyms), no punctuation | `\"image: unknown format\"`, `\"invalid id\"` |\n| Import alias | short, only on collision | `mrand \"math\u002Frand\"`, `pb \"app\u002Fproto\"` |\n| Format func | `f` suffix | `Errorf`, `Wrapf`, `Logf` |\n| Test table fields | `got`\u002F`expected` prefixes | `input string`, `expected int` |\n\n## MixedCaps\n\nAll Go identifiers MUST use `MixedCaps` (or `mixedCaps`). NEVER use underscores in identifiers — the only exceptions are test function subcases (`TestFoo_InvalidInput`), generated code, and OS\u002Fcgo interop. This is load-bearing, not cosmetic — Go's export mechanism relies on capitalization, and tooling assumes MixedCaps throughout.\n\n```go\n\u002F\u002F ✓ Good\nMaxPacketSize\nuserCount\nparseHTTPResponse\n\n\u002F\u002F ✗ Bad — these conventions conflict with Go's export mechanism and tooling expectations\nMAX_PACKET_SIZE   \u002F\u002F C\u002FPython style\nmax_packet_size   \u002F\u002F snake_case\nkMaxBufferSize    \u002F\u002F Hungarian notation\n```\n\n## Avoid Stuttering\n\nGo call sites always include the package name, so repeating it in the identifier wastes the reader's time — `http.HTTPClient` forces parsing \"HTTP\" twice. A name MUST NOT repeat information already present in the package name, type name, or surrounding context.\n\n```go\n\u002F\u002F Good — clean at the call site\nhttp.Client       \u002F\u002F not http.HTTPClient\njson.Decoder      \u002F\u002F not json.JSONDecoder\nuser.New()        \u002F\u002F not user.NewUser()\nconfig.Parse()    \u002F\u002F not config.ParseConfig()\n\n\u002F\u002F In package sqldb:\ntype Connection struct{}  \u002F\u002F not DBConnection — \"db\" is already in the package name\n\n\u002F\u002F Anti-stutter applies to ALL exported types, not just the primary struct:\n\u002F\u002F In package dbpool:\ntype Pool struct{}        \u002F\u002F not DBPool\ntype Status struct{}      \u002F\u002F not PoolStatus — callers write dbpool.Status\ntype Option func(*Pool)   \u002F\u002F not PoolOption\n```\n\n## Frequently Missed Conventions\n\nThese conventions are correct but non-obvious — they are the most common source of naming mistakes:\n\n**Constructor naming:** When a package exports a single primary type, the constructor is `New()`, not `NewTypeName()`. This avoids stuttering — callers write `apiclient.New()` not `apiclient.NewClient()`. Use `NewTypeName()` only when a package has multiple constructible types (like `http.NewRequest`, `http.NewServeMux`).\n\n**Boolean struct fields:** Unexported boolean fields MUST use `is`\u002F`has`\u002F`can` prefix — `isConnected`, `hasPermission`, not bare `connected` or `permission`. The exported getter keeps the prefix: `IsConnected() bool`. This reads naturally as a question and distinguishes booleans from other types.\n\n**Error strings are fully lowercase — including acronyms.** Write `\"invalid message id\"` not `\"invalid message ID\"`, because error strings are often concatenated with other context (`fmt.Errorf(\"parsing token: %w\", err)`) and mixed case looks wrong mid-sentence. Sentinel errors should include the package name as prefix: `errors.New(\"apiclient: not found\")`.\n\n**Enum zero values:** Always place an explicit `Unknown`\u002F`Invalid` sentinel at iota position 0. A `var s Status` silently becomes 0 — if that maps to a real state like `StatusReady`, code can behave as if a status was deliberately chosen when it wasn't.\n\n**Subtest names:** Table-driven test case names in `t.Run()` should be fully lowercase descriptive phrases: `\"valid id\"`, `\"empty input\"` — not `\"valid ID\"` or `\"Valid Input\"`.\n\n## Detailed Categories\n\nFor complete rules, examples, and rationale, see:\n\n- **[Packages, Files & Import Aliasing](.\u002Freferences\u002Fpackages-files.md)** — Package naming (single word, lowercase, no plurals), file naming conventions, import alias patterns (only use on collision to avoid cognitive load), and directory structure.\n\n- **[Variables, Booleans, Receivers & Acronyms](.\u002Freferences\u002Fidentifiers.md)** — Scope-based naming (length matches scope: `i` for 3-line loops, longer names for package-level), single-letter receiver conventions (`s` for Server), acronym casing (URL not Url, HTTPServer not HttpServer), and boolean naming patterns (isReady, hasPrefix).\n\n- **[Functions, Methods & Options](.\u002Freferences\u002Ffunctions-methods.md)** — Getter\u002Fsetter patterns (Go omits `Get` so `user.Name()` reads naturally), constructor conventions (`New` or `NewTypeName`), named returns (for documentation only), format function suffixes (`Errorf`, `Wrapf`), and functional options (`WithPort`, `WithLogger`).\n\n- **[Types, Constants & Errors](.\u002Freferences\u002Ftypes-errors.md)** — Interface naming (`Reader`, `Closer` suffix with `-er`), struct naming (nouns, MixedCaps), constants (MixedCaps, not ALL_CAPS), enums (type name prefix like `StatusReady`), sentinel errors (`ErrNotFound` variables), error types (`PathError` suffix), and error message conventions (lowercase, no punctuation).\n\n- **[Test Naming](.\u002Freferences\u002Ftesting.md)** — Test function naming (`TestFunctionName`), table-driven test field conventions (`input`, `expected`), test helper naming, and subcase naming patterns.\n\n## Common Mistakes\n\n| Mistake | Fix |\n| --- | --- |\n| `ALL_CAPS` constants | Go reserves casing for visibility, not emphasis — use `MixedCaps` (`MaxRetries`) |\n| `GetName()` getter | Go omits `Get` because `user.Name()` reads naturally at call sites. But `Is`\u002F`Has`\u002F`Can` prefixes are kept for boolean predicates: `IsHealthy() bool` not `Healthy() bool` |\n| `Url`, `Http`, `Json` acronyms | Mixed-case acronyms create ambiguity (`HttpsUrl` — is it `Https+Url`?). Use all caps or all lower |\n| `this` or `self` receiver | Go methods are called frequently — use 1-2 letter abbreviation (`s` for `Server`) to reduce visual noise |\n| `util`, `helper` packages | These names say nothing about content — use specific names that describe the abstraction |\n| `http.HTTPClient` stuttering | Package name is always present at call site — `http.Client` avoids reading \"HTTP\" twice |\n| `user.NewUser()` constructor | Single primary type uses `New()` — `user.New()` avoids repeating the type name |\n| `connected bool` field | Bare adjective is ambiguous — use `isConnected` so the field reads as a true\u002Ffalse question |\n| `\"invalid message ID\"` error | Error strings must be fully lowercase including acronyms — `\"invalid message id\"` |\n| `StatusReady` at iota 0 | Zero value should be a sentinel — `StatusUnknown` at 0 catches uninitialized values |\n| `\"not found\"` error string | Sentinel errors should include the package name — `\"mypackage: not found\"` identifies the origin |\n| `userSlice` type-in-name | Types encode implementation detail — `users` describes what it holds, not how |\n| Inconsistent receiver names | Switching names across methods of the same type confuses readers — use one name consistently |\n| `snake_case` identifiers | Underscores conflict with Go's MixedCaps convention and tooling expectations — use `mixedCaps` |\n| Long names for short scopes | Name length should match scope — `i` is fine for a 3-line loop, `userIndex` is noise |\n| Naming constants by value | Values change, roles don't — `DefaultPort` survives a port change, `Port8080` doesn't |\n| `FetchCtx()` context variant | `WithContext` is the standard Go suffix — `FetchWithContext()` is instantly recognizable |\n| `sort()` in-place but no `In` | Readers assume functions return new values. `SortIn()` signals mutation |\n| `parse()` panicking on error | `MustParse()` warns callers that failure panics — surprises belong in the name |\n| Mixing `With*`, `Set*`, `Use*` | Consistency across the codebase — `With*` is the Go convention for functional options |\n| Plural package names | Go convention is singular (`net\u002Furl` not `net\u002Furls`) — keeps import paths consistent |\n| `Wrapf` without `f` suffix | The `f` suffix signals format-string semantics — `Wrapf`, `Errorf` tell callers to pass format args |\n| Unnecessary import aliases | Aliases add cognitive load. Only alias on collision — `mrand \"math\u002Frand\"` |\n| Inconsistent concept names | Using `user`\u002F`account`\u002F`person` for the same concept forces readers to track synonyms — pick one name |\n\n## Enforce with Linters\n\nMany naming convention issues are caught automatically by linters: `revive`, `predeclared`, `misspell`, `errname`. See [golang-linter](..\u002Fgolang-linter\u002FSKILL.md) for configuration and usage.\n\n## Cross-References\n\n- → See [golang-code-style](..\u002Fgolang-code-style\u002FSKILL.md) for broader formatting and style decisions\n- → See [golang-structs-interfaces](..\u002Fgolang-structs-interfaces\u002FSKILL.md) for interface naming depth and receiver design\n- → See [golang-linter](..\u002Fgolang-linter\u002FSKILL.md) for automated enforcement (revive, predeclared, misspell, errname)\n",{"name":5,"license":15,"metadata":44,"description":7,"allowed-tools":54,"compatibility":55,"user-invocable":40},{"author":45,"version":46,"openclaw":47},"samber","1.0",{"emoji":48,"install":49,"homepage":50,"requires":51},"?️",[],"https:\u002F\u002Fgithub.com\u002Fpaulohgodinho\u002Fskills",{"bins":52},[53],"go","Read Edit Write Glob Grep Bash(go:*) Bash(golangci-lint:*) Bash(git:*) Agent","Designed for Claude Code or similar AI coding agents, and for projects using Golang.","main","f1ec08caf4f3441b371842829bc5b7e2fae2b11a","skills\u002Fgo\u002Fgolang-naming","https:\u002F\u002Fgithub.com\u002Fpaulohgodinho","2026-04-04 09:40:33",{"source":8,"skillName":5,"commands":62,"prompt":72,"zipAvailable":73},[63,66,69],{"tool":64,"command":65},"npx","npx skills add paulohgodinho\u002Fskills --skill golang-naming",{"tool":67,"command":68},"bunx","bunx skills add paulohgodinho\u002Fskills --skill golang-naming",{"tool":70,"command":71},"pnpm","pnpm dlx skills add paulohgodinho\u002Fskills --skill golang-naming","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fpaulohgodinho\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fgo\u002Fgolang-naming\u002FSKILL.md",true,[75,81,85,89,93,97],{"path":76,"resourceType":77,"resourceTypeDesc":78,"sizeBytes":79,"sourceHtmlUrl":80},"evals\u002Fevals.json","REFERENCE","参考文档",27276,"https:\u002F\u002Fgithub.com\u002Fpaulohgodinho\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fgo\u002Fgolang-naming\u002Fevals\u002Fevals.json",{"path":82,"resourceType":77,"resourceTypeDesc":78,"sizeBytes":83,"sourceHtmlUrl":84},"references\u002Ffunctions-methods.md",4055,"https:\u002F\u002Fgithub.com\u002Fpaulohgodinho\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fgo\u002Fgolang-naming\u002Freferences\u002Ffunctions-methods.md",{"path":86,"resourceType":77,"resourceTypeDesc":78,"sizeBytes":87,"sourceHtmlUrl":88},"references\u002Fidentifiers.md",5218,"https:\u002F\u002Fgithub.com\u002Fpaulohgodinho\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fgo\u002Fgolang-naming\u002Freferences\u002Fidentifiers.md",{"path":90,"resourceType":77,"resourceTypeDesc":78,"sizeBytes":91,"sourceHtmlUrl":92},"references\u002Fpackages-files.md",3049,"https:\u002F\u002Fgithub.com\u002Fpaulohgodinho\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fgo\u002Fgolang-naming\u002Freferences\u002Fpackages-files.md",{"path":94,"resourceType":77,"resourceTypeDesc":78,"sizeBytes":95,"sourceHtmlUrl":96},"references\u002Ftesting.md",1263,"https:\u002F\u002Fgithub.com\u002Fpaulohgodinho\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fgo\u002Fgolang-naming\u002Freferences\u002Ftesting.md",{"path":98,"resourceType":77,"resourceTypeDesc":78,"sizeBytes":99,"sourceHtmlUrl":100},"references\u002Ftypes-errors.md",4229,"https:\u002F\u002Fgithub.com\u002Fpaulohgodinho\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fgo\u002Fgolang-naming\u002Freferences\u002Ftypes-errors.md",[102,121,139,155,169,185],{"skillNo":103,"name":104,"nameZh":6,"description":105,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":106,"categories":107,"keywords":108,"publishedAt":39},"01M6JZD7VH66ESK96RANN6C5J1","golang-structs-interfaces","Golang struct and interface design patterns — composition, embedding, type assertions, type switches, interface segregation, dependency injection via interfaces, struct field tags, and pointer vs value receivers. Use this skill when designing Go types, defining or implementing interfaces, embedding structs or interfaces, writing type assertions or type switches, adding struct field tags for JSON\u002FYAML\u002FDB serialization, or choosing between pointer and value receivers. Also use when the user asks about \"accept interfaces, return structs\", compile-time interface checks, or composing small interfaces into larger ones.","https:\u002F\u002Fgithub.com\u002Fpaulohgodinho\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fgo\u002Fgolang-structs-interfaces\u002FSKILL.md",[],[19,109,110,23,38,36,111,35,33,32,112,113,114,115,116,28,117,118,119,120],"golang structs interfaces","design","Composition","write","dependency","design patterns","time","db","embedding","types","interface","implementing",{"skillNo":122,"name":123,"nameZh":6,"description":124,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":125,"categories":126,"keywords":127,"publishedAt":39},"01M6JZD385E2VQ9MEPJGZK2RH5","golang-project-layout","Provides a guide for setting up Golang project layouts and workspaces. Use this whenever starting a new Go project, organizing an existing codebase, setting up a monorepo with multiple packages, creating CLI tools with multiple main packages, or deciding on directory structure. Apply this for any Go project initialization or restructuring work.","https:\u002F\u002Fgithub.com\u002Fpaulohgodinho\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fgo\u002Fgolang-project-layout\u002FSKILL.md",[],[19,128,129,130,131,132,38,37,36,35,33,133,134,32,112,135,136,56,137,138],"golang project layout","project","layout","directory","cli","monorepo","work","up","workspaces","structure","initialization",{"skillNo":140,"name":141,"nameZh":6,"description":142,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":143,"categories":144,"keywords":145,"publishedAt":39},"01M6JZCRJPW41M4A70HYKEMN19","golang-lint","Provides linting best practices and golangci-lint configuration for Go projects. Covers running linters, configuring .golangci.yml, suppressing warnings with nolint directives, interpreting lint output, and managing linter settings. Use this skill whenever the user runs linters, configures golangci-lint, asks about lint warnings or suppressions, sets up code quality tooling, or asks which linters to enable for a Go project. Also use when the user mentions golangci-lint, go vet, staticcheck, revive, or any Go linting tool.","https:\u002F\u002Fgithub.com\u002Fpaulohgodinho\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fgo\u002Fgolang-linter\u002FSKILL.md",[],[146,19,147,53,38,36,148,35,33,149,150,151,32,112,152,135,129,28,153,154],"lint","golang lint","git","coding","linter","brew","edit","linting","which",{"skillNo":156,"name":157,"nameZh":6,"description":158,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":159,"categories":160,"keywords":161,"publishedAt":39},"01M6JZCKDKSZ49ZH7ZS4STSMC7","golang-design-patterns","Idiomatic Golang design patterns — functional options, constructors, error flow and cascading, resource management and lifecycle, graceful shutdown, resilience, architecture, dependency injection, data handling, and streaming. Apply when designing Go APIs, structuring applications, choosing between patterns, making design decisions, architectural choices, or production hardening.","https:\u002F\u002Fgithub.com\u002Fpaulohgodinho\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fgo\u002Fgolang-design-patterns\u002FSKILL.md",[],[110,19,114,162,163,164,38,165,36,166,35,33,32,113,167,30,28,27,26,168],"golang design patterns","patterns","architecture","resilience","streaming","shutdown","resource management",{"skillNo":170,"name":171,"nameZh":6,"description":172,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":173,"categories":174,"keywords":175,"publishedAt":39},"01M6JZCE2S3X0WWK38MZSTHH3A","golang-dependency-injection","Comprehensive guide for dependency injection (DI) in Golang. Covers why DI matters (testability, loose coupling, separation of concerns, lifecycle management), manual constructor injection, and DI library comparison (google\u002Fwire, uber-go\u002Fdig, uber-go\u002Ffx). Use this skill when designing service architecture, setting up dependency injection, refactoring tightly coupled code, managing singletons or service factories, or when the user asks about inversion of control, service containers, or wiring dependencies in Go.","https:\u002F\u002Fgithub.com\u002Fpaulohgodinho\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fgo\u002Fgolang-dependency-injection\u002FSKILL.md",[],[19,176,113,177,178,179,164,38,36,180,35,34,33,32,135,181,182,28,183,184],"injection","golang dependency injection","dependency injection","MCP","why","context7","query","separation of concerns","wiring",{"skillNo":186,"name":187,"nameZh":6,"description":188,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":189,"categories":190,"keywords":191,"publishedAt":39},"01M6JZC9YB4PHATT09BNY5B4WK","golang-code-style","Golang code style, formatting and conventions. Use when writing code, reviewing style, configuring linters, writing comments, or establishing project standards.","https:\u002F\u002Fgithub.com\u002Fpaulohgodinho\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fgo\u002Fgolang-code-style\u002FSKILL.md",[],[192,36,19,193,194,23,53,38,148,35,33,149,32,112,152,195,129,196,28,197],"code style","golang code style","style","standards","formatting","for"]