3 ms·
> It turns out we can use Go's built in support for inheritance to avoid this work. There is no support for inheritance in Go, calling struct embedding inherit
by spriggan3 10y ago
> It turns out we can use Go's built in support for inheritance to avoid this work.
There is no support for inheritance in Go, calling struct embedding inheritance is incorrect. Inheritance implies a type hierarchy, there is no type hierarchy in Go, types are flat. If you think you can mimick inheritance with struct embedding you're going to feel a whole lot of pain when you pass values around functions then expect boxing / unboxing types to work in like C# or Java.