Skip to content
Opensource internals
  • Posts

Iterators

range over func: The Compiler Turns a Loop Into a Coroutine

Oct 21, 2026 20 min read Jay Hubbert

The compiler rewrites a range-over-func loop into a yield callback, tracks iterator misbehaviour with a state machine, and hands coroutine switching to iter.Pull.

GoInternalsIteratorsCompilerRuntime

Read more →

© 2026 Jay Hubbert · Built with Hugo 0.168.0

RSS ·