~/talk

Shattered Mirror: An Introduction to Reflect and Unsafe

Talkat dotGo 2019 · on Monday, 2019-03-25· [go]
slides:none on file

A custom state machine executor is built that wires step functions together with runtime dependency injection using reflect.MakeFunc and inspection of function signatures; it works but produces opaque stack traces and a brittle “mess in the middle.” The talk shows how reflect inspects and constructs types and values at runtime (including marshaling), and how unsafe.Pointer and uintptr let syscall bindings and pointer casts bypass Go’s type system; conclusion: reflect is fine for reading or marshaling, avoid reflection for runtime DI and avoid unsafe unless necessary.

AI-written summary · about

  1. 0:00Reflect and Unsafe intro
  2. 1:46Why reflect and unsafe matter
  3. 3:30Go’s type system
  4. 6:49Exploring reflect package
  5. 10:29Reflect in dependency injection
  6. 11:35Unsafe in Go
  7. 13:51How unsafe powers reflect
  8. 14:58Reflect pitfalls
  9. 16:44Best practices for reflect
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.