Now let's say that we have the Citi Bike station data in our stationData struct value and we want to save that data out to a file. We can do this with json.marshal:
// Marshal the data. outputData, err := json.Marshal(sd) if err != nil { log.Fatal(err) }
// Save the marshalled data to a file. if err := ioutil.WriteFile("citibike.json", outputData, 0644); err != nil { log.Fatal(err) }