Module 15 Β· Design Patterns in Go β Lesson 8 of 8 Β· ~8 min
Composition over Inheritance
Go deleted inheritance on purpose
The closing lesson, and the one that reframes all the others. Go has no classes and no inheritance β no extends, no base class, no super. That sounds like a missing feature; it's a deliberate design choice. Half the Gang-of-Four catalog exists to work around the rigidity of inheritance hierarchies. Remove inheritance and many of those patterns simply evaporate.
Go replaces inheritance with two tools: struct embedding (composition) and small interfaces. You've used both all course. This lesson names them.