2 ms·
As a Go learner, the best explanation that has made sense to me is that interface types essentially just compose two pointers: P1: The type and its method vtab
by zero_shift 11mo ago
As a Go learner, the best explanation that has made sense to me is that interface types essentially just compose two pointers:
P1: The type and its method vtable
P2: The value
Once I understood that I could intuit how a nil Foo was not a nil Bar and not an untyped nil either
- whateveracct 11mo agoah yes of course - key semantics of `nil` should totally depend on deep implementation details in my language's runtime. willem-dafoe-head-tap.gif