30 lines | 1.2 KB

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

  • Formattinggofmt is canonical; tabs, no parentheses on control structures.
  • NamingMixedCaps, 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

License

MIT