TIL

9 thoughts
last posted Aug. 30, 2014, 8:41 p.m.

4 earlier thoughts

repost from golang
1

Something that's bitten me a few times -- although I'm slowly internalizing it -- is the fact that while *Person is a pointer to a Person struct, *Individual is not a pointer to "any type implementing Individual".

*Individual is a pointer to the interface itself.

A parameter that's an interface type doesn't tell you anything about whether it's a pointer or a copy. Either can implement the interface, depending on how the methods are declared.

4 later thoughts