Skip to content
Skillv1.0.0

go-code-review

Use when reviewing Go code or preparing code for review. Quick-reference checklist covering naming, error handling, concurrency, testing, imports, documentation, and common pitfalls. Based on Go Wiki

by saisudhir14(0) 0 installs
Free
Sign in to install

Free account. Installing gives you the manifest plus copy-paste snippets.

See reviews

About

Imported from saisudhir14/claude-skills (skills/go-code-review/SKILL.md). Install upstream with npx skills add saisudhir14/claude-skills --skill go-code-review. Copyright stays with the author (MIT).

Go Code Review Checklist

Quick-reference checklist for reviewing Go code. Each item links to deeper guidance in the parent skill.

Naming

  • MixedCaps used (no underscores)
  • Initialisms are consistent case (URL, ID, HTTP)
  • Variable names match scope (short for local, descriptive for global)
  • Receiver names are 1-2 letters, consistent across methods
  • Package names are lowercase single words, no util/common/misc
  • No name repetition (package.Method, not package.PackageMethod)

Error Handling

  • Errors returned, not panicked (production code)
  • Error wrapping uses %w or %v appropriately
  • Error context is succinct (no "failed to" chains)
  • Errors handled once (not logged AND returned)
  • Error strings are lowercase, no trailing punctuation
  • Happy path at minimal indentation (error-first)
  • Sentinel errors use Err prefix, error types use Error suffix

Concurrency

  • Channel buffers are 0 or 1 (or justified)
  • Goroutine lifetimes are documented
  • errgroup used for error-returning goroutines
  • Functions are synchronous unless concurrency is essential
  • Mutexes are zero-value, unexported, not embedded in public structs
  • Typed atomics used (Go 1.19+)

Testing

  • Table-driven tests with named subtests
  • Subtests run in parallel where safe
  • go-cmp used for struct comparisons
  • Failure messages include input, got, want
  • t.Fatal for setup errors, t.Error for test assertions
  • Interfaces defined in consumer packages

Imports

  • Three groups: stdlib, external, internal
  • No unnecessary renames
  • No dot imports (except circular dep tests)
  • Blank imports only in main/tests

Structs

  • Field names used in initialization (no positional)
  • Zero value fields omitted
  • Types not embedded in public structs
  • JSON field tags on marshaled structs

Slices and Maps

  • Nil slices preferred over empty slices
  • Copied at boundaries to prevent mutation
  • Capacity preallocated when size is known
  • Standard library slices/maps packages used

Performance

  • strconv used over fmt for conversions
  • No repeated string-to-byte conversions
  • Map and slice capacity preallocated
  • strings.Builder used for concatenation

Documentation

  • Exported declarations have doc comments
  • Comments are full sentences starting with declared name
  • Package has package comment

Patterns

  • Functional options for complex constructors
  • Interface compliance verified at compile time
  • defer used for resource cleanup
  • Context is first parameter
  • No mutable globals (dependency injection instead)
  • Type assertions use two-value form
  • time.Duration used instead of raw integers
  • Enums start at one (zero = invalid)

Common Gotchas

  • No loop variable capture bugs (Go 1.22+ or shadowed)
  • Defer argument evaluation understood
  • Nil interface vs nil pointer handled correctly
  • Error checked before using result
  • No map iteration order dependency
  • Slice append backing array understood

Use it

Copy one of these into your project. Installing also returns the manifest and these snippets.

yaml
targets:
  - https://api.opensmartroute.ai/api/v1/registry/saisudhir14-claude-skills-go-code-review/manifest   # or paste the manifest below

Manifest

An Open Capability Manifest: the router reads it to know what this does, what it costs and when to pick it.

saisudhir14-claude-skills-go-code-review.ocm.jsonjson
{
  "ocm": "1",
  "id": "saisudhir14-claude-skills-go-code-review",
  "kind": "skill",
  "name": "go-code-review",
  "description": "Use when reviewing Go code or preparing code for review. Quick-reference checklist covering naming, error handling, concurrency, testing, imports, documentation, and common pitfalls. Based on Go Wiki CodeReviewComments.",
  "publisher": "saisudhir14",
  "version": "1.0.0",
  "capabilities": {
    "domains": [
      "coding"
    ],
    "tags": [
      "skill-md",
      "golang",
      "go",
      "code-review",
      "checklist",
      "linting",
      "style",
      "skills-sh"
    ],
    "languages": [
      "en"
    ]
  },
  "quality_prior": 0.6,
  "examples": [
    "Use when reviewing Go code or preparing code for review. Quick-reference checklist covering naming, error handling, concurrency, testing, imports, documentation, and common pitfalls. Based on Go Wiki CodeReviewComments."
  ],
  "primary": false,
  "metadata": {
    "source": {
      "provider": "skills.sh",
      "repository": "https://github.com/saisudhir14/claude-skills",
      "path": "skills/go-code-review/SKILL.md",
      "ref": "HEAD",
      "url": "https://github.com/saisudhir14/claude-skills/blob/HEAD/skills/go-code-review/SKILL.md",
      "key": "saisudhir14/claude-skills/skills/go-code-review/SKILL.md"
    },
    "license": "MIT"
  },
  "instructions": "# Go Code Review Checklist\n\nQuick-reference checklist for reviewing Go code. Each item links to deeper guidance in the parent skill.\n\n## Naming\n\n- [ ] MixedCaps used (no underscores)\n- [ ] Initialisms are consistent case (URL, ID, HTTP)\n- [ ] Variable names match scope (short for local, descriptive for global)\n- [ ] Receiver names are 1-2 letters, consistent across methods\n- [ ] Package names are lowercase single words, no util/common/misc\n- [ ] No name repetition (package.Method, not package.PackageMethod)\n\n## Error Handling\n\n- [ ] Errors returned, not panicked (production code)\n- [ ] Error w",
  "cost": {
    "context_tokens": 789
  }
}

Fetch it by URL: GET /api/v1/registry/saisudhir14-claude-skills-go-code-review/manifest?version=1.0.0

Reviews

Star ratings from people who tried it. One review per account; edit yours any time.

No reviews yet. Install it, try it, and be the first to rate it.