我无法将此 json 解析为我的结构。任何人都可以帮忙吗
{"error":false,"response":{"results":[{"id":68876,"name":"cee lo green - big girls"},{"id":68954,"name":"charles, ray - the girl friend"},{"id":69603,"name":"charlie puth - la girls"},{"id":68001,"name":"city girls - careless"},{"id":68000,"name":"city girls - millionaire dick"},{"id":68002,"name":"city girls - period (we live)"},{"id":68004,"name":"city girls - rap shit"},{"id":68003,"name":"city girls - runnin"},{"id":68019,"name":"clairo - pretty girl"},{"id":68223,"name":"cohn, marc - girl of mysterious sorrow"},{"id":68343,"name":"contours, the - searching for a girl"}
下面是我的 struct package main
导入(“编码/json”“fmt”“io/ioutil”“log”“net/http”)
类型测试结构 { SngID 字符串json:"id"
SngNm 字符串json:"name"
} 类型内部结构 {
Result[10] test `json:"results"`
}
type Outer struct{ Eror bool json:"error"
Response [] Innerjson:"results"
}
白猪掌柜的
相关分类