Day: December 1, 2016

  • Golang: Polymorphism

    Polymorphism is a bit different in Go. It supports polymorphism only through interfaces (and not through inheritance). To help you understand better, here is an example: import “fmt” type Car interface { func Drive() } type Lamborgini struct { // Implement the Car interface func Drive() { fmt.Println(“Driving”) } } func driveACar(car Car) { car.Drive()…