Summary
In this chapter, we got into the advanced uses of variables and types in Go. Real-world code gets complicated quickly because the real world is complicated. Being able to model the data accurately and keep that data logically organized in your code helps reduce the complexity of your code to a minimum.
You now know how to group similar data, either in a fixed-length ordered list using an array, in a dynamic length ordered list using a slice, or in a key-value hash using a map.
We learned to go beyond Go's core types and start to create custom types based either directly on the core types or by creating a struct, which is a collection of other types held in a single type and value.
There are times when you'll have type mismatches, so Go gives us the ability to convert compatible types so that they can interact in a type-safe way.
Go also lets us break free of its type safety rules and gives us full control. By using type assertions, we can accept any type...