Best PracticesEffective Go — Naming, Errors & Interfaces
All courses

Proverbs turned into code review comments

  • Short names in small scopes; longer names for exported API.
  • Sentinel errors (var ErrX) for expected cases.
  • Wrap with %w; check with errors.Is / errors.As.
  • Accept interfaces, return concrete types.
  • Make the zero value useful.
Output
Press Run to execute your code.