- 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)
}
推薦閱讀
- C#高級編程(第10版) C# 6 & .NET Core 1.0 (.NET開發經典名著)
- ASP.NET Core 5.0開發入門與實戰
- Java Web基礎與實例教程
- PHP+MySQL+Dreamweaver動態網站開發實例教程
- Python貝葉斯分析(第2版)
- Spring Boot進階:原理、實戰與面試題分析
- 數據結構習題解析與實驗指導
- 編程菜鳥學Python數據分析
- 小程序,巧應用:微信小程序開發實戰(第2版)
- SQL Server 2016 從入門到實戰(視頻教學版)
- SAP Web Dynpro for ABAP開發技術詳解:基礎應用
- Building Clouds with Windows Azure Pack
- Raspberry Pi Robotic Projects
- Swift Essentials(Second Edition)
- Practical Time Series Analysis