No Inheritance – Type embedding

A struct to inherit the methods of another struct, here the current Person struct A new struct type called Student  which has all the properties and methods of Person. the type Person inside the struct definition of type Student, without specifying a field name. This will effectively make the Student type inherit all the exported methods and fields of the Person struct type.

Go: Map

A map is a collection of key value pairs, where you use the key to obtain the value that corresponds to it. The preceding code declares a map where the keys are of type int, and the values are of type string. var myMap map[int]string Initialize a map using the make function: Read more…