logoalt Hacker News

Zanfatoday at 5:55 PM3 repliesview on HN

But you can do equally horrible inheritance-y things with embedded structs.


Replies

metadattoday at 6:07 PM

Yes, though it's non-idiomatic and in my experience, rare to encounter in the wild for anything you'd actually want to use.

EspressoGPTtoday at 7:49 PM

That's right, embedded structs in Go are far less common than inheritance in Java though.

saturn_vktoday at 7:59 PM

That’s composition, and it’s not really the same as inheritance