Reality check

It's not important that the cars collection remain pure; frankly, that's not feasible, given that the Go compiler currently does not provide TCO. What's important is that our code improves with the use of functional programming techniques. Granted, this one, AddCars, is the furthest function we have from pure, but it is useful and it does improve our programs' readability. We do need to be careful when we use non-pure functions, especially ones that mutate their state, but this usage is perfectly fine for our purposes.

We find AddCars in cars.go:

func (cars Collection) AddCars(carsToAdd Collection) Collection {
return append(cars, carsToAdd...)
}