What is the internal representation of an interface (the iface and eface structs)?

Last updated 20 June 2026

  • An interface value is two words: type information plus a data pointer to the value (often heap-allocated, causing the value to escape).

  • eface (empty interface) holds a *_type metadata pointer. iface (interface with methods) holds an *itab caching the concrete type and a method dispatch table.

  • An interface is nil only when both the type word and the data word are nil.

  • https://github.com/golang/gofrontend/blob/master/go/runtime.def
  • https://www.henrydu.com/2021/02/07/golang-interface-brief-look/
  • https://github.com/golang/go/blob/master/src/runtime/iface.go
All Golang interview questions