Curriculum Idioms & ecosystem Common gotchas exercise 9 · freeform
Common gotchas
About this theme
The "what bit me in code review" survival kit:
- Loop variable capture (Go 1.22+ helped, but you should still know).
- Nil interface vs nil concrete (a non-nil pointer inside an interface variable makes the interface non-nil).
- Slice aliasing — two slices sharing a backing array.
- Goroutine leaks — a goroutine waiting on a channel that nobody will ever send to.