Comment on Object-Oriented Inheritance in GoComments−echlebek10yThis is not inheritance, but rather embedding. A form of composition. Go does not have inheritance.https://golang.org/doc/effective_go.html#embedding−timtadhOP10yAuthor 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.
Comments
This is not inheritance, but rather embedding. A form of composition. Go does not have inheritance.
https://golang.org/doc/effective_go.html#embedding
Author 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.