3 ms·
Yeah, it's surprising too. I was programming for a good week in Go before I discovered anonymous fields and how they worked. They really need to do a better job
by hacknat 12y ago
Yeah, it's surprising too. I was programming for a good week in Go before I discovered anonymous fields and how they worked. They really need to do a better job of explaining that they have a form of inheritance in the language that allows structs to exhibit polymorphism beyond being an interface as it isn't really explicitly stated anywhere in the docs. The section in the FAQ that answers if Go is an OO language never makes explicit reference to them, and in the language spec they don't get their own section.