这里是我写的结构
data := make(map[string]interface{})
data["sign_type"] = "sign"
data["dev_sno"] = "888088"
data["register_no"] = "888088"
data["type"] = "1"
dataPersonInfo := make(map[string]int)
dataPersonInfo.PushBack(map[string]int{
"person_type": 4,
"total": 10,
})
dataPersonInfo.PushBack(map[string]int{
"person_type": 3,
"total": 5,
})
data["personInfo"] = dataPersonInfo
下面是想要输出的结构
{
"sign_type": "sign",
"dev_sno": "888999",
"register_no": "888999",
"type": "1",
"personInfo": [
{
"person_type": 4,
"total": 10
},
{
"person_type": 3,
"total": 5
}
]
}