Welcome to the Go Playbook, a comprehensive, practical, and production-oriented guide to mastering Go (Golang). This repository is designed for experienced software engineers who want to move beyond basic syntax and learn how to build robust, concurrent, and high-performance systems in Go.
This playbook is hands-on. Instead of long academic documents, it is broken down into tiered topics. Each topic folder contains a README.md detailing the production concepts, common pitfalls, and architectural decisions, accompanied by a set of real-world exercises (with failing tests) for you to solve.
The curriculum is divided into three tiers:
Focuses on the fundamentals of the language, but strictly through the lens of Go's unique mechanics, memory behavior, and idioms.
- 01. Core Syntax
- 02. Control Flow
- 03. Functions
- 04. Standard Collections
- 05. Pointers
- 06. Errors (Foundational)
- 07. Defer, Panic, Recover
- 08. Strings, Bytes, and Runes
- 09. Time
Focuses on writing idiomatic, safe, and easily testable components. It heavily targets real-world production concurrency primitives and data handling.
- 10. Methods and Composition
- 11. Packages and Modules
- 12. Tooling & Static Analysis
- 13. Goroutines
- 14. Channels
- 15. Synchronization Primitives
- 16. Context
- 17. Idiomatic Error Handling (Advanced)
- 18. Testing
- 19. Filesystem & OS
- 20. Database & IO Patterns
- 21. HTTP and JSON
Focuses on the deepest parts of Go: memory management, compiler optimizations, architectural patterns at scale, and observability.
- 22. Advanced Concurrency Patterns
- 23. Memory Model
- 24. Garbage Collector
- 25. Generics
- 26. Reflection
- 27. Profiling & Observability
- 28. Go in Production
- 29. Go Infrastructure
- Pick a Topic: Navigate to a topic folder (e.g.,
basic/04-standard-collections). - Read the
README.md: Learn the production context, pitfalls, and idiomatic patterns. - Run the Tests: Run
go test -v ./...inside the folder. The tests will fail intentionally. - Solve the Exercises: Open the
.gofiles, follow theTODOmarkers, and refactor the buggy or incomplete code. - Verify: Keep running the tests (and
go test -race ./...for concurrency) until you've successfully implemented the resilient solution.
For a detailed breakdown of every single sub-topic covered within these sections, refer to the roadmap.md.