package main import ( jsoniter "github.com/json-iterator/go" ) func String2Bytes(data string) []byte { return []byte(data) } func main() { s := `{"code":200,"data":[[851,532],[874,529],[895,525],[915,520],[934,514],[951,507],[967,498],[982,488],[995,477],[1006,465],[101 6,452],[1024,437],[1032,422],[1032,422],[930,429],[834,439],[741,451],[654,466],[570,483],[491,504],[416,526],[346,551],[280,579],[219,609],[162, 642],[110,678],[110,678],[157,625],[205,577],[254,533],[304,493],[356,457],[408,426],[462,399],[517,376],[572,358],[629,343],[687,333],[747,328]] ,"msg":"success"}` var result map[string]interface{} var json = jsoniter.ConfigCompatibleWithStandardLibrary err := json.Unmarshal(String2Bytes(s), &result) if err != nil { println(err.Error()) } println(result["data"].([]interface{})[0].([]interface{})[0].(float64)) }
标签:678,err,golang,json,result,interface,解析,data From: https://www.cnblogs.com/angdh/p/17144370.html