Go doesn’t have a concept of class or have a class-based inheritance. Go is a bit different than the regular object-oriented languages.
Go has a unique feature called embedded fields in the struct(More like composition). Using those we can reuse the code, it is pretty much similar to what Inheritance provides in other languages.
#golang #inheritance #design-patterns #go #embedded-fields-in-go