You should know by now that Go does not use inheritance; instead, it supports composition. Go interfaces provide a kind of polymorphism. So, although Go is not an object-oriented programming language, it has some features that allow us to mimic object-oriented programming.
If you really want to develop applications using the object-oriented methodology, then choosing Go might not be your best option. As I am not really into Java, I would suggest looking at C++ or Python instead.
First, let me explain to you the two techniques that will be used in the Go program of this section. The first technique uses methods in order to associate a function with a type, which means that in some ways, the function and the type construct an object. In the second technique, you embed a type into a new structure type in order to create a kind of hierarchy.
There...