12. Files and Systems
Activity 12.01: Parsing Bank Transaction Files
Solution:
All directories and files created should be inside your $GOPATH
.
- Create a
Chapter12/Activity12.01/
directory. - Inside
Chapter12/Activity12.01/
, create amain.go
file. - Add the following code to the
main.go
file:package main import ( Â Â "encoding/csv" Â Â "errors" Â Â "flag" Â Â "fmt" Â Â "io" Â Â "log" Â Â "os" Â Â "strconv" Â Â "strings" )
- Create budget category types for fuel, food, mortgage, repairs, insurance, utilities, and retirement:
type budgetCategory string const (   autoFuel budgetCategory = "fuel"   food  budgetCategory = "food"   mortgage budgetCategory = "mortgage"   repairs  budgetCategory = "repairs"...