What is the internal representation of an interface (the iface and eface structs)?
Last updated
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*_typemetadata pointer.iface(interface with methods) holds an*itabcaching the concrete type and a method dispatch table.An interface is nil only when both the type word and the data word are nil.