Summary
In this chapter, we learned about interfaces, which are like contracts, and also about type methods, type assertion, and reflection. Although reflection is a very powerful Go feature, it might slow down your Go programs because it adds a layer of complexity at runtime. Furthermore, your Go programs could crash if you use reflection carelessly. However, reflection is not usually needed unless you want to perform low-level tasks with Go variables.
Remember that interfaces specify behavior, specify what you can do, and not what a data type is. Code that uses interfaces successfully is more readable, more extensible, and simpler to understand. Last, keep in mind that interfaces are implemented implicitly once the required type methods are implemented.
This chapter also discussed writing Go code that follows the principles of object-oriented programming. If you are going to remember just one thing from this chapter, it should be that Go is not an object-oriented programming...