```go
package main
import (
"encoding/json"
"fmt"
)
type Person struct {
Age string `json:"status"`
Data Data `json:"data"`
Name string `json:"name"`
}
type Data struct {
Values []map[string]interface{} `json:"result"`
}
func main() {
// 假数据
b := []byte(`{"status":"success","wmd":{"result":"wmd"},"name":"wmd","data":{"resultType":"matrix","result":[{"metric":{"__name__":"namedprocess_namegroup_memory_bytes","groupname":"root","instance":"localhost:9256","job":"process_export_9256","memtype":"resident"},"values":[[1635991200,"300257280"],[1635993000,"302428160"],[1635994800,"301727744"]]}]}}`)
var p Person
err := json.Unmarshal(b, &p)
if err != nil {
fmt.Println(err)
}
wmd := p.Data.Values[0]["values"]
fmt.Println(wmd)
}
```
### 上面是代码,最后解析出来的是 interface 类型数据,但是我没办法给拿出来变成字符串或者数组类型的,没办法进行求和、平均值啊这类的。求大佬们指教
有疑问加站长微信联系(非本文作者))