[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6JZC9YB4PHATT09BNY5B4WK":3,"skill-same:01M6JZC9YB4PHATT09BNY5B4WK":84},{"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":55,"commitSha":56,"skillDirectory":57,"forksCount":14,"repositoryHtmlUrl":50,"repositoryHomepageUrl":6,"ownerHtmlUrl":58,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":59,"install":60,"resources":73},"01M6JZC9YB4PHATT09BNY5B4WK","golang-code-style",null,"Golang code style, formatting and conventions. Use when writing code, reviewing style, configuring linters, writing comments, or establishing project standards.","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-code-style\u002FSKILL.md",[],[19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38],"code style","style","code","golang","golang code style","read","for","false","formatting","project","standards","edit","write","writing","coding","projects","Bash","git","ai coding agents","go","2026-11-10 10:12:30",false,"---\nname: golang-code-style\ndescription: \"Golang code style, formatting and conventions. Use when writing code, reviewing style, configuring linters, writing comments, or establishing project standards.\"\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-code-style` skill takes precedence.\n\n# Go Code Style\n\nStyle rules that require human judgment — linters handle formatting, this skill handles clarity. For naming see [golang-naming](..\u002Fgolang-naming\u002FSKILL.md); for design patterns see [golang-design-patterns](..\u002Fgolang-design-patterns\u002FSKILL.md); for struct\u002Finterface design see [golang-structs-interfaces](..\u002Fgolang-structs-interfaces\u002FSKILL.md).\n\n> \"Clear is better than clever.\" — Go Proverbs\n\nWhen ignoring a rule, add a comment to the code.\n\n## Line Length & Breaking\n\nNo rigid line limit, but lines beyond ~120 characters MUST be broken. Break at **semantic boundaries**, not arbitrary column counts. Function calls with 4+ arguments MUST use one argument per line — even when the prompt asks for single-line code:\n\n```go\n\u002F\u002F Good — each argument on its own line, closing paren separate\nmux.HandleFunc(\"\u002Fapi\u002Fusers\", func(w http.ResponseWriter, r *http.Request) {\n    handleUsers(\n        w,\n        r,\n        serviceName,\n        cfg,\n        logger,\n        authMiddleware,\n    )\n})\n```\n\nWhen a function signature is too long, the real fix is often **fewer parameters** (use an options struct) rather than better line wrapping. For multi-line signatures, put each parameter on its own line.\n\n## Variable Declarations\n\nSHOULD use `:=` for non-zero values, `var` for zero-value initialization. The form signals intent: `var` means \"this starts at zero.\"\n\n```go\nvar count int              \u002F\u002F zero value, set later\nname := \"default\"          \u002F\u002F non-zero, := is appropriate\nvar buf bytes.Buffer       \u002F\u002F zero value is ready to use\n```\n\n### Slice & Map Initialization\n\nSlices and maps MUST be initialized explicitly, never nil. Nil maps panic on write; nil slices serialize to `null` in JSON (vs `[]` for empty slices), surprising API consumers.\n\n```go\nusers := []User{}                       \u002F\u002F always initialized\nm := map[string]int{}                   \u002F\u002F always initialized\nusers := make([]User, 0, len(ids))      \u002F\u002F preallocate when capacity is known\nm := make(map[string]int, len(items))   \u002F\u002F preallocate when size is known\n```\n\nDo not preallocate speculatively — `make([]T, 0, 1000)` wastes memory when the common case is 10 items.\n\n### Composite Literals\n\nComposite literals MUST use field names — positional fields break when the type adds or reorders fields:\n\n```go\nsrv := &http.Server{\n    Addr:         \":8080\",\n    ReadTimeout:  5 * time.Second,\n    WriteTimeout: 10 * time.Second,\n}\n```\n\n## Control Flow\n\n### Reduce Nesting\n\nErrors and edge cases MUST be handled first (early return). Keep the happy path at minimal indentation:\n\n```go\nfunc process(data []byte) (*Result, error) {\n    if len(data) == 0 {\n        return nil, errors.New(\"empty data\")\n    }\n\n    parsed, err := parse(data)\n    if err != nil {\n        return nil, fmt.Errorf(\"parsing: %w\", err)\n    }\n\n    return transform(parsed), nil\n}\n```\n\n### Eliminate Unnecessary `else`\n\nWhen the `if` body ends with `return`\u002F`break`\u002F`continue`, the `else` MUST be dropped. Use default-then-override for simple assignments — assign a default, then override with independent conditions or a `switch`:\n\n```go\n\u002F\u002F Good — default-then-override with switch (cleanest for mutually exclusive overrides)\nlevel := slog.LevelInfo\nswitch {\ncase debug:\n    level = slog.LevelDebug\ncase verbose:\n    level = slog.LevelWarn\n}\n\n\u002F\u002F Bad — else-if chain hides that there's a default\nif debug {\n    level = slog.LevelDebug\n} else if verbose {\n    level = slog.LevelWarn\n} else {\n    level = slog.LevelInfo\n}\n```\n\n### Complex Conditions & Init Scope\n\nWhen an `if` condition has 3+ operands, MUST extract into named booleans — a wall of `||` is unreadable and hides business logic. Keep expensive checks inline for short-circuit benefit. [Details](.\u002Freferences\u002Fdetails.md)\n\n```go\n\u002F\u002F Good — named booleans make intent clear\nisAdmin := user.Role == RoleAdmin\nisOwner := resource.OwnerID == user.ID\nisPublicVerified := resource.IsPublic && user.IsVerified\nif isAdmin || isOwner || isPublicVerified || permissions.Contains(PermOverride) {\n    allow()\n}\n```\n\nScope variables to `if` blocks when only needed for the check:\n\n```go\nif err := validate(input); err != nil {\n    return err\n}\n```\n\n### Switch Over If-Else Chains\n\nWhen comparing the same variable multiple times, prefer `switch`:\n\n```go\nswitch status {\ncase StatusActive:\n    activate()\ncase StatusInactive:\n    deactivate()\ndefault:\n    panic(fmt.Sprintf(\"unexpected status: %d\", status))\n}\n```\n\n## Function Design\n\n- Functions SHOULD be **short and focused** — one function, one job.\n- Functions SHOULD have **≤4 parameters**. Beyond that, use an options struct (see [golang-design-patterns](..\u002Fgolang-design-patterns\u002FSKILL.md)).\n- **Parameter order**: `context.Context` first, then inputs, then output destinations.\n- Naked returns help in very short functions (1-3 lines) where return values are obvious, but become confusing when readers must scroll to find what's returned — name returns explicitly in longer functions.\n\n```go\nfunc FetchUser(ctx context.Context, id string) (*User, error)\nfunc SendEmail(ctx context.Context, msg EmailMessage) error  \u002F\u002F grouped into struct\n```\n\n### Prefer `range` for Iteration\n\nSHOULD use `range` over index-based loops. Use `range n` (Go 1.22+) for simple counting.\n\n```go\nfor _, user := range users {\n    process(user)\n}\n```\n\n## Comments\n\nComments are a last resort. When code requires a comment to be understood, the first instinct MUST be to rename, restructure, or simplify — not to add a comment. A comment that restates what a name already expresses is noise: it adds clutter and drifts out of sync with the code.\n\n### Never Comment These\n\n```go\n\u002F\u002F Bad — comment just repeats the function name\n\n\u002F\u002F getUserByID returns a user by their ID\nfunc getUserByID(ctx context.Context, id string) (*User, error) { ... }\n\n\u002F\u002F Bad — comment repeats the variable assignment\n\n\u002F\u002F isActive checks whether the user is active\nisActive := user.Status == StatusActive\n\n\u002F\u002F Bad — comment restates the loop count\n\n\u002F\u002F Retry the request up to 3 times\nfor range 3 { ... }\n```\n\n### Only Comment These\n\nThe only legitimate reasons to add a comment are:\n\n- **Magic numbers \u002F hardcoded values** — explain *why* the value is what it is\n- **Non-obvious logic** — explain *why*, not *what*\n- **Intentional no-ops** — prevent the next reader from thinking it's a bug\n- **`TODO` \u002F `FIXME`** — track known issues or planned work\n\n```go\n\u002F\u002F Good — magic number with rationale\nconst gcGracePeriod = 2 * time.Minute \u002F\u002F GC finalizers can delay ~1min; double for safety\n\n\u002F\u002F Good — non-obvious invariant\n\u002F\u002F Subtract 1: the token bucket counts from 0, so capacity N gives N+1 slots;\n\u002F\u002F correct here to match the documented API contract.\navailable := bucket.Cap() - 1\n\n\u002F\u002F Good — intentional no-op\nselect {\ncase \u003C-done:\n    return\ndefault:\n    \u002F\u002F not ready yet — continue\n}\n\n\u002F\u002F Good — tracking known work\n\u002F\u002F TODO: replace with streaming once the upstream API supports it\ndata, err := io.ReadAll(r)\n\n\u002F\u002F FIXME: this silently drops the error on context cancellation\n_ = client.Flush()\n```\n\n### Godoc Exception\n\nExported symbols MAY have a godoc comment so that `go doc` and IDEs work correctly. Even then, prefer a name so clear that the godoc is a single short sentence — not a paragraph explaining what the code already shows.\n\n```go\n\u002F\u002F Good — godoc adds genuinely useful context beyond the name\n\u002F\u002F ParseDuration extends time.ParseDuration to support 'd' (day) and 'w' (week) units.\nfunc ParseDuration(s string) (time.Duration, error) { ... }\n\n\u002F\u002F Bad — godoc just echoes the name\n\u002F\u002F GetUser retrieves a user.\nfunc GetUser(ctx context.Context, id string) (*User, error) { ... }\n```\n\n### Rule of Thumb\n\nBefore writing a comment, ask: *can I express this with a better name or a helper function?*\n\n```go\n\u002F\u002F Bad — comment compensates for a cryptic condition\n\u002F\u002F skip unverified users created before the migration cutoff\nif user.DeletedAt != nil || (!user.IsVerified && user.CreatedAt.Before(cutoff)) {\n\n\u002F\u002F Good — extract into a named boolean\nshouldSkip := user.DeletedAt != nil || (!user.IsVerified && user.CreatedAt.Before(cutoff))\nif shouldSkip {\n```\n\n## Value vs Pointer Arguments\n\nPass small types (`string`, `int`, `bool`, `time.Time`) by value. Use pointers when mutating, for large structs (~128+ bytes), or when nil is meaningful. [Details](.\u002Freferences\u002Fdetails.md)\n\n## Code Organization Within Files\n\n- **Group related declarations**: type, constructor, methods together\n- **Order**: package doc, imports, constants, types, constructors, methods, helpers\n- **One primary type per file** when it has significant methods\n- **Blank imports** (`_ \"pkg\"`) register side effects (init functions). Restricting them to `main` and test packages makes side effects visible at the application root, not hidden in library code\n- **Dot imports** pollute the namespace and make it impossible to tell where a name comes from — never use in library code\n- **Unexport aggressively** — you can always export later; unexporting is a breaking change\n\n## String Handling\n\nUse `strconv` for simple conversions (faster), `fmt.Sprintf` for complex formatting. Use `%q` in error messages to make string boundaries visible. Use `strings.Builder` for loops, `+` for simple concatenation.\n\n## Type Conversions\n\nPrefer explicit, narrow conversions. Use generics over `any` when a concrete type will do:\n\n```go\nfunc Contains[T comparable](slice []T, target T) bool  \u002F\u002F not []any\n```\n\n## Philosophy\n\n- **\"A little copying is better than a little dependency\"**\n- **Use `slices` and `maps` standard packages**\n- **\"Reflection is never clear\"** — avoid `reflect` unless necessary\n- **Don't abstract prematurely** — extract when the pattern is stable\n- **Minimize public surface** — every exported name is a commitment\n\n## Parallelizing Code Style Reviews\n\nWhen reviewing code style across a large codebase, use up to 5 parallel sub-agents (via the Agent tool), each targeting an independent style concern (e.g. control flow, function design, variable declarations, string handling, code organization).\n\n## Enforce with Linters\n\nMany rules are enforced automatically: `gofmt`, `gofumpt`, `goimports`, `gocritic`, `revive`, `wsl_v5`. → See the [golang-linter](..\u002Fgolang-linter\u002FSKILL.md) skill.\n\n## Cross-References\n\n- → See [golang-naming](..\u002Fgolang-naming\u002FSKILL.md) for identifier naming conventions\n- → See [golang-structs-interfaces](..\u002Fgolang-structs-interfaces\u002FSKILL.md) for pointer vs value receivers, interface design\n- → See [golang-design-patterns](..\u002Fgolang-design-patterns\u002FSKILL.md) for functional options, builders, constructors\n- → See [golang-linter](..\u002Fgolang-linter\u002FSKILL.md) for automated formatting enforcement\n","> **Community default.** A company skill that explicitly supersedes `samber\u002Fcc-skills-golang@golang-code-style` skill takes precedence.\n\n# Go Code Style\n\nStyle rules that require human judgment — linters handle formatting, this skill handles clarity. For naming see [golang-naming](..\u002Fgolang-naming\u002FSKILL.md); for design patterns see [golang-design-patterns](..\u002Fgolang-design-patterns\u002FSKILL.md); for struct\u002Finterface design see [golang-structs-interfaces](..\u002Fgolang-structs-interfaces\u002FSKILL.md).\n\n> \"Clear is better than clever.\" — Go Proverbs\n\nWhen ignoring a rule, add a comment to the code.\n\n## Line Length & Breaking\n\nNo rigid line limit, but lines beyond ~120 characters MUST be broken. Break at **semantic boundaries**, not arbitrary column counts. Function calls with 4+ arguments MUST use one argument per line — even when the prompt asks for single-line code:\n\n```go\n\u002F\u002F Good — each argument on its own line, closing paren separate\nmux.HandleFunc(\"\u002Fapi\u002Fusers\", func(w http.ResponseWriter, r *http.Request) {\n    handleUsers(\n        w,\n        r,\n        serviceName,\n        cfg,\n        logger,\n        authMiddleware,\n    )\n})\n```\n\nWhen a function signature is too long, the real fix is often **fewer parameters** (use an options struct) rather than better line wrapping. For multi-line signatures, put each parameter on its own line.\n\n## Variable Declarations\n\nSHOULD use `:=` for non-zero values, `var` for zero-value initialization. The form signals intent: `var` means \"this starts at zero.\"\n\n```go\nvar count int              \u002F\u002F zero value, set later\nname := \"default\"          \u002F\u002F non-zero, := is appropriate\nvar buf bytes.Buffer       \u002F\u002F zero value is ready to use\n```\n\n### Slice & Map Initialization\n\nSlices and maps MUST be initialized explicitly, never nil. Nil maps panic on write; nil slices serialize to `null` in JSON (vs `[]` for empty slices), surprising API consumers.\n\n```go\nusers := []User{}                       \u002F\u002F always initialized\nm := map[string]int{}                   \u002F\u002F always initialized\nusers := make([]User, 0, len(ids))      \u002F\u002F preallocate when capacity is known\nm := make(map[string]int, len(items))   \u002F\u002F preallocate when size is known\n```\n\nDo not preallocate speculatively — `make([]T, 0, 1000)` wastes memory when the common case is 10 items.\n\n### Composite Literals\n\nComposite literals MUST use field names — positional fields break when the type adds or reorders fields:\n\n```go\nsrv := &http.Server{\n    Addr:         \":8080\",\n    ReadTimeout:  5 * time.Second,\n    WriteTimeout: 10 * time.Second,\n}\n```\n\n## Control Flow\n\n### Reduce Nesting\n\nErrors and edge cases MUST be handled first (early return). Keep the happy path at minimal indentation:\n\n```go\nfunc process(data []byte) (*Result, error) {\n    if len(data) == 0 {\n        return nil, errors.New(\"empty data\")\n    }\n\n    parsed, err := parse(data)\n    if err != nil {\n        return nil, fmt.Errorf(\"parsing: %w\", err)\n    }\n\n    return transform(parsed), nil\n}\n```\n\n### Eliminate Unnecessary `else`\n\nWhen the `if` body ends with `return`\u002F`break`\u002F`continue`, the `else` MUST be dropped. Use default-then-override for simple assignments — assign a default, then override with independent conditions or a `switch`:\n\n```go\n\u002F\u002F Good — default-then-override with switch (cleanest for mutually exclusive overrides)\nlevel := slog.LevelInfo\nswitch {\ncase debug:\n    level = slog.LevelDebug\ncase verbose:\n    level = slog.LevelWarn\n}\n\n\u002F\u002F Bad — else-if chain hides that there's a default\nif debug {\n    level = slog.LevelDebug\n} else if verbose {\n    level = slog.LevelWarn\n} else {\n    level = slog.LevelInfo\n}\n```\n\n### Complex Conditions & Init Scope\n\nWhen an `if` condition has 3+ operands, MUST extract into named booleans — a wall of `||` is unreadable and hides business logic. Keep expensive checks inline for short-circuit benefit. [Details](.\u002Freferences\u002Fdetails.md)\n\n```go\n\u002F\u002F Good — named booleans make intent clear\nisAdmin := user.Role == RoleAdmin\nisOwner := resource.OwnerID == user.ID\nisPublicVerified := resource.IsPublic && user.IsVerified\nif isAdmin || isOwner || isPublicVerified || permissions.Contains(PermOverride) {\n    allow()\n}\n```\n\nScope variables to `if` blocks when only needed for the check:\n\n```go\nif err := validate(input); err != nil {\n    return err\n}\n```\n\n### Switch Over If-Else Chains\n\nWhen comparing the same variable multiple times, prefer `switch`:\n\n```go\nswitch status {\ncase StatusActive:\n    activate()\ncase StatusInactive:\n    deactivate()\ndefault:\n    panic(fmt.Sprintf(\"unexpected status: %d\", status))\n}\n```\n\n## Function Design\n\n- Functions SHOULD be **short and focused** — one function, one job.\n- Functions SHOULD have **≤4 parameters**. Beyond that, use an options struct (see [golang-design-patterns](..\u002Fgolang-design-patterns\u002FSKILL.md)).\n- **Parameter order**: `context.Context` first, then inputs, then output destinations.\n- Naked returns help in very short functions (1-3 lines) where return values are obvious, but become confusing when readers must scroll to find what's returned — name returns explicitly in longer functions.\n\n```go\nfunc FetchUser(ctx context.Context, id string) (*User, error)\nfunc SendEmail(ctx context.Context, msg EmailMessage) error  \u002F\u002F grouped into struct\n```\n\n### Prefer `range` for Iteration\n\nSHOULD use `range` over index-based loops. Use `range n` (Go 1.22+) for simple counting.\n\n```go\nfor _, user := range users {\n    process(user)\n}\n```\n\n## Comments\n\nComments are a last resort. When code requires a comment to be understood, the first instinct MUST be to rename, restructure, or simplify — not to add a comment. A comment that restates what a name already expresses is noise: it adds clutter and drifts out of sync with the code.\n\n### Never Comment These\n\n```go\n\u002F\u002F Bad — comment just repeats the function name\n\n\u002F\u002F getUserByID returns a user by their ID\nfunc getUserByID(ctx context.Context, id string) (*User, error) { ... }\n\n\u002F\u002F Bad — comment repeats the variable assignment\n\n\u002F\u002F isActive checks whether the user is active\nisActive := user.Status == StatusActive\n\n\u002F\u002F Bad — comment restates the loop count\n\n\u002F\u002F Retry the request up to 3 times\nfor range 3 { ... }\n```\n\n### Only Comment These\n\nThe only legitimate reasons to add a comment are:\n\n- **Magic numbers \u002F hardcoded values** — explain *why* the value is what it is\n- **Non-obvious logic** — explain *why*, not *what*\n- **Intentional no-ops** — prevent the next reader from thinking it's a bug\n- **`TODO` \u002F `FIXME`** — track known issues or planned work\n\n```go\n\u002F\u002F Good — magic number with rationale\nconst gcGracePeriod = 2 * time.Minute \u002F\u002F GC finalizers can delay ~1min; double for safety\n\n\u002F\u002F Good — non-obvious invariant\n\u002F\u002F Subtract 1: the token bucket counts from 0, so capacity N gives N+1 slots;\n\u002F\u002F correct here to match the documented API contract.\navailable := bucket.Cap() - 1\n\n\u002F\u002F Good — intentional no-op\nselect {\ncase \u003C-done:\n    return\ndefault:\n    \u002F\u002F not ready yet — continue\n}\n\n\u002F\u002F Good — tracking known work\n\u002F\u002F TODO: replace with streaming once the upstream API supports it\ndata, err := io.ReadAll(r)\n\n\u002F\u002F FIXME: this silently drops the error on context cancellation\n_ = client.Flush()\n```\n\n### Godoc Exception\n\nExported symbols MAY have a godoc comment so that `go doc` and IDEs work correctly. Even then, prefer a name so clear that the godoc is a single short sentence — not a paragraph explaining what the code already shows.\n\n```go\n\u002F\u002F Good — godoc adds genuinely useful context beyond the name\n\u002F\u002F ParseDuration extends time.ParseDuration to support 'd' (day) and 'w' (week) units.\nfunc ParseDuration(s string) (time.Duration, error) { ... }\n\n\u002F\u002F Bad — godoc just echoes the name\n\u002F\u002F GetUser retrieves a user.\nfunc GetUser(ctx context.Context, id string) (*User, error) { ... }\n```\n\n### Rule of Thumb\n\nBefore writing a comment, ask: *can I express this with a better name or a helper function?*\n\n```go\n\u002F\u002F Bad — comment compensates for a cryptic condition\n\u002F\u002F skip unverified users created before the migration cutoff\nif user.DeletedAt != nil || (!user.IsVerified && user.CreatedAt.Before(cutoff)) {\n\n\u002F\u002F Good — extract into a named boolean\nshouldSkip := user.DeletedAt != nil || (!user.IsVerified && user.CreatedAt.Before(cutoff))\nif shouldSkip {\n```\n\n## Value vs Pointer Arguments\n\nPass small types (`string`, `int`, `bool`, `time.Time`) by value. Use pointers when mutating, for large structs (~128+ bytes), or when nil is meaningful. [Details](.\u002Freferences\u002Fdetails.md)\n\n## Code Organization Within Files\n\n- **Group related declarations**: type, constructor, methods together\n- **Order**: package doc, imports, constants, types, constructors, methods, helpers\n- **One primary type per file** when it has significant methods\n- **Blank imports** (`_ \"pkg\"`) register side effects (init functions). Restricting them to `main` and test packages makes side effects visible at the application root, not hidden in library code\n- **Dot imports** pollute the namespace and make it impossible to tell where a name comes from — never use in library code\n- **Unexport aggressively** — you can always export later; unexporting is a breaking change\n\n## String Handling\n\nUse `strconv` for simple conversions (faster), `fmt.Sprintf` for complex formatting. Use `%q` in error messages to make string boundaries visible. Use `strings.Builder` for loops, `+` for simple concatenation.\n\n## Type Conversions\n\nPrefer explicit, narrow conversions. Use generics over `any` when a concrete type will do:\n\n```go\nfunc Contains[T comparable](slice []T, target T) bool  \u002F\u002F not []any\n```\n\n## Philosophy\n\n- **\"A little copying is better than a little dependency\"**\n- **Use `slices` and `maps` standard packages**\n- **\"Reflection is never clear\"** — avoid `reflect` unless necessary\n- **Don't abstract prematurely** — extract when the pattern is stable\n- **Minimize public surface** — every exported name is a commitment\n\n## Parallelizing Code Style Reviews\n\nWhen reviewing code style across a large codebase, use up to 5 parallel sub-agents (via the Agent tool), each targeting an independent style concern (e.g. control flow, function design, variable declarations, string handling, code organization).\n\n## Enforce with Linters\n\nMany rules are enforced automatically: `gofmt`, `gofumpt`, `goimports`, `gocritic`, `revive`, `wsl_v5`. → See the [golang-linter](..\u002Fgolang-linter\u002FSKILL.md) skill.\n\n## Cross-References\n\n- → See [golang-naming](..\u002Fgolang-naming\u002FSKILL.md) for identifier naming conventions\n- → See [golang-structs-interfaces](..\u002Fgolang-structs-interfaces\u002FSKILL.md) for pointer vs value receivers, interface design\n- → See [golang-design-patterns](..\u002Fgolang-design-patterns\u002FSKILL.md) for functional options, builders, constructors\n- → See [golang-linter](..\u002Fgolang-linter\u002FSKILL.md) for automated formatting enforcement\n",{"name":5,"license":15,"metadata":44,"description":7,"allowed-tools":53,"compatibility":54,"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},[38],"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-code-style","https:\u002F\u002Fgithub.com\u002Fpaulohgodinho","2026-04-04 09:40:33",{"source":8,"skillName":5,"commands":61,"prompt":71,"zipAvailable":72},[62,65,68],{"tool":63,"command":64},"npx","npx skills add paulohgodinho\u002Fskills --skill golang-code-style",{"tool":66,"command":67},"bunx","bunx skills add paulohgodinho\u002Fskills --skill golang-code-style",{"tool":69,"command":70},"pnpm","pnpm dlx skills add paulohgodinho\u002Fskills --skill golang-code-style","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fpaulohgodinho\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fgo\u002Fgolang-code-style\u002FSKILL.md",true,[74,80],{"path":75,"resourceType":76,"resourceTypeDesc":77,"sizeBytes":78,"sourceHtmlUrl":79},"evals\u002Fevals.json","REFERENCE","参考文档",32553,"https:\u002F\u002Fgithub.com\u002Fpaulohgodinho\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fgo\u002Fgolang-code-style\u002Fevals\u002Fevals.json",{"path":81,"resourceType":76,"resourceTypeDesc":77,"sizeBytes":82,"sourceHtmlUrl":83},"references\u002Fdetails.md",2722,"https:\u002F\u002Fgithub.com\u002Fpaulohgodinho\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fgo\u002Fgolang-code-style\u002Freferences\u002Fdetails.md",[85,103,121,139,152,166],{"skillNo":86,"name":87,"nameZh":6,"description":88,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":89,"categories":90,"keywords":91,"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",[],[22,92,93,32,37,21,94,35,34,24,31,95,96,97,98,26,99,100,101,102],"golang structs interfaces","design","Composition","dependency","design patterns","time","db","embedding","types","interface","implementing",{"skillNo":104,"name":105,"nameZh":6,"description":106,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":107,"categories":108,"keywords":109,"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",[],[22,110,28,111,112,113,37,114,21,35,34,115,116,24,31,117,118,55,119,120],"golang project layout","layout","directory","cli","packages","monorepo","work","up","workspaces","structure","initialization",{"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},"01M6JZCXBFYKM5A7W8QHBG5SP6","golang-naming","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.","https:\u002F\u002Fgithub.com\u002Fpaulohgodinho\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fgo\u002Fgolang-naming\u002FSKILL.md",[],[22,128,129,32,37,114,21,35,130,34,24,131,132,133,26,134,135,136,137,138],"golang naming","naming","refactoring","anti-patterns","options","get","error","functional","errors","utils","at",{"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,22,147,38,37,21,36,35,34,33,148,149,24,31,30,117,28,26,150,151],"lint","golang lint","linter","brew","linting","which",{"skillNo":153,"name":154,"nameZh":6,"description":155,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":156,"categories":157,"keywords":158,"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",[],[93,22,96,159,160,161,37,162,21,163,35,34,24,95,164,132,26,134,135,165],"golang design patterns","patterns","architecture","resilience","streaming","shutdown","resource management",{"skillNo":167,"name":168,"nameZh":6,"description":169,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":170,"categories":171,"keywords":172,"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",[],[22,173,95,174,175,176,161,37,21,177,35,130,34,24,117,178,179,26,180,181],"injection","golang dependency injection","dependency injection","MCP","why","context7","query","separation of concerns","wiring"]