Interface

Interface and Composition

In today’s post we are going to look at how Go supports interface and composition. Interface and composition form the base of any language and Go is no different. Interface Interface is defined as group of methods without the actual method implementation. It is the responsibility of implementer of the interface to provide the actual implementation. Thus Interface can be considered as a contract/protocol which needs to be fulfilled by implementer.