November 2017
Intermediate to advanced
670 pages
17h 35m
English
Let's open http://localhost:8000/cars to see the full list of cars from both cars.csv and more_cars.csv:

Let's take a look at the next Filter function in action in main.go:
PrintCars("Numeric", cars.Filter(ByHasNumber()))
You will see the following output:
Numeric-----------------------car: Honda Accord ES2car: Lexus IS250car: Lexus SC 430car: Ford F-150car: Toyota 86car: Toyota RAV4car: GM Hummer H2car: GM Hummer H3
The FilterFunc method used in this case is ByHasNumber(). It operates like ByMake FilterFunc and uses Go's regexp MatchString function to return true if the car has a number in it:
func ByHasNumber() FilterFunc ...