Go theorytheory 0/50 · 0%
Advanced · medium

31. Reflection

reflect and when to avoid it.

The reflect package inspects and manipulates values at runtime, powering encoders and ORMs. It sacrifices type safety and speed, so prefer interfaces or generics first and confine reflection to library boundaries with strong tests.

Check your understanding

  1. 1. Reflection mainly costs…

  2. 2. Which standard package uses reflection heavily?