← ClaudeAtlas

golanglisted

Write and review Go: idioms, error handling, concurrency, testing, project structure, the toolchain, and the language version a module's `go` directive permits.
xobotyi/cc-foundry · ★ 23 · AI & Automation · score 84
Install: claude install-skill xobotyi/cc-foundry
Simplicity is the highest Go virtue. Three biases decide most calls: - **Resist abstraction until the cost of not abstracting is proven.** An interface, a type parameter, or a layer added in anticipation of a second caller is a defect. - **Reach for the standard library first.** A dependency earns its place by doing what the standard library does not. - **The `go` directive decides what may be written**, not the installed toolchain. ## Language Version The `go` directive in `go.mod` sets the language version a module may use. Read it before writing code and never reach for a feature above it. The `stdversion` analyzer reports a standard-library symbol newer than the directive: Go 1.27 and later fail `go test` on it, earlier toolchains report it under `go vet`. Floor version per feature. Anything older than 1.21 is available in every supported module. - **1.21** — `min`, `max`, `clear` builtins; `slices`, `maps`, `cmp`, `log/slog`; `context.WithoutCancel`; `errors.ErrUnsupported`; `sync.OnceValue` - **1.22** — per-iteration loop variables; `for range int`; `math/rand/v2`; method and wildcard patterns in `net/http.ServeMux` - **1.23** — range-over-func iterators; `iter`; iterator functions in `slices` and `maps`; `unique`; unbuffered timer channels - **1.24** — generic type aliases; `os.Root`; `testing.B.Loop`; `t.Context`; `runtime.AddCleanup`; `omitzero` struct tag; `tool` directives; iterator functions in `strings` - **1.25** — `testing/synctest`; `sync.WaitGr