In this chapter, we reviewed the Go memory model for interfaces in detail, highlighting that an interface always contains a concrete type. We used this information to get a better look at type casting and understand what happens when an interface gets cast to another.
Then, we introduced the basic mechanics of reflection, starting with type and value, which are the two main types of the package. They represent, respectively, the type and value of a variable. Value allows you to read a variable content and also to write it if the variable is addressable. In order to be addressable, a variable needs to be accessed from its address, using a pointer, for instance.
We also saw how complex data types can be handled with reflection, seeing how to access structure field value. Data types of structure can be used to get metadata about fields, including name and tags, which are...