- Machine Learning With Go
- Daniel Whitenack
- 70字
- 2021-07-08 10:37:27
JSON output
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)
}
推薦閱讀
- Learning Single:page Web Application Development
- Oracle Exadata性能優化
- 高效微控制器C語言編程
- PostgreSQL Cookbook
- Hands-On Image Processing with Python
- 精通軟件性能測試與LoadRunner實戰(第2版)
- JSP開發案例教程
- Learning Salesforce Einstein
- WordPress 4.0 Site Blueprints(Second Edition)
- C語言程序設計實驗指導 (第2版)
- Python High Performance Programming
- FFmpeg開發實戰:從零基礎到短視頻上線
- JavaScript前端開發基礎教程
- Flask開發Web搜索引擎入門與實戰
- Beginning C# 7 Hands-On:The Core Language