英文: How do I transform a document before I assign it to a structure in Go using MongoDB? 问题 我正在使用Go和...
将地图编组为JSON时丢失数据。
英文: Missing data when Marshalling map to JSON 问题 我正在尝试将一个名为Foo的结构体转换为JSON,其中包含一个名为Values map[string]...
这个简洁的JSON文档对应的Go结构体是什么?
英文: What would be the Go structs for this terse JSON document? 问题 该文档有意地只包含最少的键值对元数据。在人员列表中,我们可以使用&q...
Go:JSON编组嵌套结构;错误地省略外部字段
英文: Go: JSON marshalling nested struct; incorrectly omitting outer fields 问题 我正在尝试编组嵌套的结构体。在这里可以看到一个...
无法将对象解组为Go类型[]uint8的值。
英文: Cannot unmarshal object into Go value of type []uint8 问题 我对Go相当新手。我有以下代码: package main import ( ...
多态的JSON反序列化嵌套结构
英文: Polymorphic JSON unmarshalling of embedded structs 问题 这是一个示例(请参见https://play.golang.org/p/or7z4X...
json: 无法将数组解组为类型为 main.Posts 的 Go 值
英文: json: cannot unmarshal array into Go value of type main.Posts 问题 我正在尝试使用Golang读取一个JSON文件,但是我遇到了这...
Go decode json string
英文: Go decode json string 问题 发现在Go语言中解析JSON是一件非常麻烦的事情,请帮忙解决一下。这是我的JSON数据: { "BTC_BCN":{ "...
如何从Go的http.Request中检索对象?
英文: How to retrieve object from Go http.Request? 问题 我有一个可以接收HTTP GET参数的工作应用程序。到目前为止,它们一直是字符串和整数,并且通过...
如何对一个 JSON 数组的值进行平均,并将结果保留一位小数点。
英文: How to average values of an array of JSONs, then round to 1 decimal point 问题 我是你的中文翻译助手,以下是翻译好的内...
285