Go patterns for errors, context, goroutines, interfaces, release changes, linters, and tests. Load before any edit to a .go file or go.mod, however small, and for Go questions.
Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Go Patterns?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/ku5ic-go-patterns)
---
name: go-patterns
description: Go patterns for errors, context, goroutines, interfaces, release changes, linters, and tests. Load before any edit to a .go file or go.mod, however small, and for Go questions.
---
# Go patterns
Default assumption: Go 1.27, per the Go Release History.
A row applies when the `go` directive in `go.mod` is at least its version. The directive sets the language version and the GODEBUG defaults, and only vet's `stdversion` reports a standard library API newer than it.
## Reference files
Loading this skill isn't enough. Before your next edit, read the file of every row that matches it. The rules live in those files, and this one only points at them.
| Before | Read |
| ------------------------------------------------------------- | -------------------------------------------------------- |
| Writing Go code, or raising the `go` directive | [reference/upgrades.md](reference/upgrades.md) |
| Writing, changing, or reviewing Go code | [reference/anti-patterns.md](reference/anti-patterns.md) |
| Returning an error, taking a context, or naming a type or API | [reference/practices.md](reference/practices.md) |
| Configuring or running vet, staticcheck, or golangci-lint | [reference/tooling.md](reference/tooling.md) |
| Writing or changing a `_test.go` file | [reference/testing.md](reference/testing.md) |