type Data struct {
Roomid string `json:"roomid`
Vod string `json:"vod`
}
type Result struct {
CmdId string `json:"cmdid"`
Code int `json:"code"`
Data []Data `json:"data"`
Message string `json:"message"`
}
str := `{
"cmdid": "createroom",
"code": 0,
"data": [
{
"roomid": 210263,
"vod": 0
}
],
"message": "Success"
}`
body := new(Result)
json.Unmarshal([]byte(str), &body)
fmt.Println(body.Data[0].Roomid)
为什么这个结果不是Success,而是空啊?
type Data struct {