go-effective
Idiomatic Go style — naming, errors, interfaces, and concurrency idioms, distilled from Effective Go and the official Go Code Review Comments.
npx rulepack add go-effective
What it covers
- Formatting —
gofmtis canonical; tabs, no parentheses on control structures. - Naming —
MixedCaps, short package names, noGetprefix,-erinterfaces, consistent initialisms. - Errors — lower-case unpunctuated error strings, handle (never discard) errors, no in-band errors, early-return flow.
- Interfaces — keep them small, accept interfaces and return concrete types, define them where they're used.
- Concurrency — share memory by communicating; channels,
select,context.Contextfirst. - Idioms — short consistent receiver names, pointer vs value receivers,
defercleanup,newvsmake, doc comments,crypto/rand.
This pack is about idiomatic style. For stdlib-first library choices
(net/http, errgroup, error wrapping) see the companion go-stdlib pack.
Source
License
MIT