Overview of the Uber Go Style Guide
masterThe Uber Go Style Guide defines the conventions and idiomatic practices used at Uber to ensure codebases remain manageable and productive. It covers more than just formatting (which is handled by gofmt) and includes guidelines on:
- Guidelines: Best practices for pointers, interfaces, mutexes, concurrency, and error handling.
- Performance: Optimization techniques like preferring
strconvoverfmtand managing container capacity. - Style: Conventions for naming, grouping declarations, reducing nesting, and initializing structs/maps.
- Patterns: Common architectural patterns like Functional Options and Test Tables.
This guide is based on Effective Go, Go Common Mistakes, and Go Code Review Comments.