agentleFS
ku5icku5ic/claude-kit/skills/go-patterns/SKILL.md

go-patterns

Skill2 starsChanged 8 days agoMITView on GitHub

Go patterns for error wrapping and inspection, context and goroutine lifetimes, Code Review Comments naming and interface placement, features from recent releases (generic methods, new(expr), errors.AsType, WaitGroup.Go, ServeMux patterns, json v2), testing helpers, and review-time anti-patterns. Use whenever the project contains `.go` files or a `go.mod`, OR the user asks about Go, goroutines, channels, contexts, or Go error handling, even if Go is not mentioned by name.

1 other project uses a version of this.

Adopted by

Most recently taken up by

The file

Files
SKILL.md

Go patterns

Default assumption: Go 1.27.

  • Language features apply according to the go directive in go.mod, not the installed toolchain. Loop-variable semantics (1.22) are the sharpest case. Check the directive before suggesting a feature.
  • Rules from Code Review Comments and the context package docs hold for every version.

Reference files

FileCovers
reference/errors.md%w wrapping, errors.Is/As/AsType/Join, error strings, panics, in-band errors
reference/context-and-concurrency.mdContext rules, cancel funcs, goroutine lifetimes, WaitGroup.Go, loop variables
reference/style.mdNaming, interface placement, and newer language and stdlib features by version
reference/testing.mdt.Context, synctest, artifacts, vet checks go test runs
reference/anti-patterns.mdSeven review-time anti-patterns with severity calls

References

Version notes

Checked: 2026-09-26 against https://go.dev/dl/?mode=json and the release notes at https://go.dev/doc/go1.27, https://go.dev/doc/go1.26, https://go.dev/doc/go1.25

  • 1.27 (1.27.1 current): generic methods; encoding/json backed by the v2 implementation, with GOEXPERIMENT=nojsonv2 as a temporary opt-out; new uuid package.
  • 1.26: new accepts an expression; errors.AsType; go fix rebuilt around modernizers; T.ArtifactDir.
  • 1.25: sync.WaitGroup.Go; testing/synctest generally available; vet's waitgroup and hostport analyzers.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.