Interface Dispatch — Itabs, Indirection, Escape, and Typed Nil
Understand the runtime cost of interface method calls — itab, indirect call, argument escape — when devirtualization removes it, and the interface-representation gotcha.
This chapter is part of the paid launch. The preview stays visible so readers can evaluate the exact scope before buying.
Core, Complete, and Team. Complete also includes the practical exam and free Go-version updates.
What this chapter teaches
Interfaces are just function pointers; the cost is one indirect call.
assigning a value to an interface usually escapes it to the heap, and the indirect call blocks inlining and downstream optimization. The itab lookup is the cheap part. (Plus the typed-nil trap: an interface holding a nil pointer is not == nil.)
Unlock Chapter 09 and the rest of the course.
Start with your email, then continue to Lemon Squeezy checkout. Core unlocks the paid chapters, Complete adds the exam and free Go-version updates, and Team gives you 5 seats.