7. Interfaces
Overview
This chapter aims to demonstrate the implementation of interfaces in Go. It is quite simple compared to other languages because it is done implicitly in Go, whereas other languages require interfaces to be implemented explicitly.
In the beginning, you will be able to define and declare an interface for an application and implement an interface in your applications. This chapter introduces you to use duck typing and polymorphism and accept interfaces and return structs.
By the end of this chapter, you will learn to use type assertion to access our interface's underlying concrete value, and use the type switch statement.