Skip to content

Comment on Struct composition with Goparent

Comments

It isn't inheritance at all. Read the other replies. When an embedded struct has a method called on it, it is completely oblivious to what it is embedded in, no different than a direct call. It does not get any sort of reference to what would be a the superclass if there was any inheritance going on.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.