Golang: Interface

In Go or Golang, declaring an interface is pretty simple and easy. type Printer interface { Print(string) } We just defined an interface named Printer that required an implementer to have a method named Print which takes a string parameter and returns nothing. Interfaces are implemented implicitly in Go. Any type that has the Print(string) method implements the interface.

Continue reading Golang: Interface