"Shattered Mirror: An Introduction to Reflect and Unsafe in Go"
summary
Shows the concrete uses and failures of reflect and unsafe by describing a real state machine executor built with reflect for runtime wiring then replaced with code generation when panics and inscrutable stack traces made debugging impossible. Demonstrates how reflect inspects and constructs types and powers marshaling, how unsafe underpins reflect and enables raw syscall conversions, and argues against runtime dependency injection with reflect while recommending one-way control flow and reflect for reading or marshalling only.
AI-written summary · about
chapters (8)
- 0:00Intro
- 0:34Reflect
- 3:35Indicators of Reflect
- 4:30Unsafe Example
- 5:11Types
- 8:35Type Information
- 14:48Unsafe
- 20:22Lessons








