4 ms·
This is not inheritance, but rather embedding. A form of composition. Go does not have inheritance. https://golang.org/doc/effective_go.html#embedding https://
by echlebek 10y ago
This is not inheritance, but rather embedding. A form of composition. Go does not have inheritance.
https://golang.org/doc/effective_go.html#embedding https://golang.org/doc/effective_go.html#embedding
- timtadh 10y agoAuthor Here: Good point. I had forgotten that the effective go document had a section on it. I will add the link. My main point is that Go embedding can be used as a form of subclassing allowing types to share, code, data or both.