解析http的repsonse--golang

2019-10-14  本文已影响0人  heliping_peter

1. 返回是json的数组,需要反序列化为接口数组

var ruser []interface{}
json.Unmashal(respBody, &ruser)
rrt := ruser[0].(map[string]interface{})
fmt.Println(rrt["user_id"])
//[{"user_id":9}]
上一篇 下一篇

猜你喜欢

热点阅读