【发布时间】:2018-01-02 05:31:58
【问题描述】:
我有一个 json 格式的复杂字符串,我想将其转换为 golang 中的地图。假设字符串是
species :{
"type" : "human"
"age" : "23"
"attributes" : {
"height" : "182"
"weight" : "160"
"contact" : {
"address" : ########
"phone" : #########
}
}
}
我如何解析它使得 map[attributes] 又是一个 map[string] 接口等等?
【问题讨论】:
-
看看encoding/json是怎么做的。
标签: dictionary go