Go's Type System — Structs, Interfaces, and Life Without Inheritance

In part 1 of this series I talked about why I'm picking up Go after six years of Java and Kotlin, plus a recent deep dive into Rust. This time I want to get into the part that actually changed how I think about designing code: Go has no class inheritance at all.

Coming from the JVM world, that sentence sounded alarming the first time I read it. No extends. No abstract classes. No polymorphism through a class hierarchy. And yet Go backends at companies running serious scale seem to do just fine without it. After a few weeks living inside Go's type system, I get why.

Structs: Data, Nothing More

A Go struct is just a typed bag of fields. No constructors, no access modifiers in the Java sense, no inheritance: