接口返回的json文件
{"success":true,"message":null,"data":{"maxUsers":"4000","avgThroughput":"1690.27","errors":"100.0000","avgResponseTime":"6.0109","responseTime90":"6.0120","avgBandwidth":"796.45","avgTransactions":"426.55"}}
使用golang解析data内部的数据
var tmpresult map[string]interface{}
json.Unmarshal(content, &tmpresult)
data := tmpresult["data"].(map[string]interface {})
maxUsers := data["maxUsers"]
网友评论