go解析未知结构的json

package main

import "github.com/tidwall/gjson"

const json = `{"name":{"first":"Janet","last":"Prichard"},"age":47}`

func main() {
	value := gjson.Get(json, "name.last")
	println(value.String())
}
posted @ 2020-09-23 11:09  公众号python学习开发  阅读(601)  评论(0编辑  收藏  举报