Skip to content
Back to skills

Go Patterns

ASecurity

Go patterns - 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.

  • 2 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added October 5, 2026
ai-agentsgoexpresstesting

Security analysis

A100/100

Pro scans all 6 files and shows the line behind each finding

Scanned October 7, 2026

npx -y skills add ku5ic/claude-kit --skill go-patterns --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Go Patterns?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Go Patterns
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/ku5ic-go-patterns/badge)](https://www.skillsdirectory.com/skills/ku5ic-go-patterns)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: go-patterns
description: Go patterns - 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.
---

# 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

| File                                                                         | Covers                                                                                 |
| ---------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- |
| [reference/errors.md](reference/errors.md)                                   | `%w` wrapping, `errors.Is`/`As`/`AsType`/`Join`, error strings, panics, in-band errors |
| [reference/context-and-concurrency.md](reference/context-and-concurrency.md) | Context rules, cancel funcs, goroutine lifetimes, `WaitGroup.Go`, loop variables       |
| [reference/style.md](reference/style.md)                                     | Naming, interface placement, and newer language and stdlib features by version         |
| [reference/testing.md](reference/testing.md)                                 | `t.Context`, `synctest`, artifacts, vet checks `go test` runs                          |
| [reference/anti-patterns.md](reference/anti-patterns.md)                     | Seven review-time anti-patterns with severity calls                                    |

## References

- Go Code Review Comments: https://go.dev/wiki/CodeReviewComments
- Effective Go: https://go.dev/doc/effective_go
- Release notes: https://go.dev/doc/devel/release
- Package context: https://pkg.go.dev/context

## 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.

Files in this skill

  • SKILL.md2.8 KB
  • reference/anti-patterns.md1.7 KB
  • reference/context-and-concurrency.md1.5 KB
  • reference/errors.md1.5 KB
  • reference/style.md2.5 KB
  • reference/testing.md1 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.