I see the dynamic type, which is part of every interface variable, as more than an implementation detail. The language spec, which is typically very careful to avoid talking about implementation issues, explicitly states that an interface variable has a dynamic type:
Variables of interface type also have a distinct *dynamic type*, which is the concrete type of the value assigned to the variable at run time (unless the value is the predeclared identifier nil, which has no type). The dynamic type may vary during execution but values stored in interface variables are always assignable <https://golang.org/ref/spec#Assignability> to the static type of the variable. The dynamic type is also crucial in the definition of equality, and it's the very mechanism used in type assertions and type switches. Thinking of an interface variable as storing both a concrete value and a dynamic type can be really helpful for understanding Go interfaces. First, it's correct by definition. Second, trying to apply concepts from different languages can lead to fuzzy thinking. In my experience, the Go language spec is often to the better teacher. :) -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.