Course
Idiomatic Go
25 lessons · Go. Start at lesson one and work through in order.
- 1. Error Handling
- 2. defer for Cleanup
- 3. Multiple Return Values
- 4. The comma ok Idiom
- 5. Implicit Interfaces
- 6. Accept Interfaces, Return Structs
- 7. Slices Are Views, Not Arrays
- 8. Capacity Matters
- 9. range Gotchas
- 10. Zero Values Are Useful
- 11. Nil Slice vs Empty Slice
- 12. Value vs Pointer Receivers
- 13. iota for Enums
- 14. context.Context
- 15. Goroutines Are Cheap, Not Free
- 16. Channels Are for Coordination
- 17. select Is Elegant
- 18. sync.Mutex Is Often Simpler
- 19. Table-Driven Tests
- 20. internal Package Is Underrated
- 21. Composition Over Inheritance
- 22. Small Packages Win
- 23. Error Values, Not Exceptions
- 24. Prefer Plain Structs
- 25. Simplicity Is a Language Feature