# go-effective Idiomatic Go *style* — naming, errors, interfaces, and concurrency idioms, distilled from *Effective Go* and the official *Go Code Review Comments*. ```bash npx rulepack add go-effective ``` ## What it covers - **Formatting** — `gofmt` is canonical; tabs, no parentheses on control structures. - **Naming** — `MixedCaps`, short package names, no `Get` prefix, `-er` interfaces, 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.Context` first. - **Idioms** — short consistent receiver names, pointer vs value receivers, `defer` cleanup, `new` vs `make`, 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 - [Effective Go](https://go.dev/doc/effective_go) - [Go Code Review Comments](https://go.dev/wiki/CodeReviewComments) ## License MIT