Goal: simple, explicit Go that reads plainly and handles errors honestly.
Use for:
- new packages, services, or CLIs in Go
- reviewing error handling, concurrency, and API shape
- simplifying over-abstracted or clever code
Workflow:
- Return errors explicitly; wrap with context using %w.
- Keep interfaces small and defined by the consumer.
- Use goroutines with clear ownership and a way to stop.
- Pass context.Context for cancellation and deadlines.
- Prefer composition and plain structs over inheritance-like tricks.
- Verify with go test, go vet, and the race detector.
Idioms:
- handle errors immediately; do not ignore them
- defer for cleanup near acquisition
- channels to communicate, mutexes to protect state
- accept interfaces, return concrete types
Rules:
- never discard an error without a stated reason
- guard shared state; run tests with -race
- keep packages cohesive; avoid util grab-bags
- clarity over cleverness; the obvious code wins