
The Go Workshop
By :

In the previous chapter, we covered Go's core types. These types are critical to everything you'll do in Go, but it can be challenging to model more complex data. In modern computer software, we want to be able to group data and logic where possible. We also want to be able to make our logic reflect the real-world solutions we're building.
If you were building software for cars, you would ideally want a custom type that embodies a car. This type should be named "car" and it should have properties that can store things about what kind of car it is. The logic that affects the car, such as starting and stopping, should be associated with the car type. If we had to manage more than one car, we need to be able to group all the cars.
In this chapter, we'll learn about the features in Go that allow us to model the data part of this challenge. Then, in the next chapter, we'll solve the behavior part. By using custom types, you can extend...