jsonpath:Golang的json对象的简单而灵活的访问接口
前往的jsonpath
Golang的json对象的简单而灵活的访问接口。
安装
go get github.com/yasuyuky/jsonpath
用法
基本用法(解码并获取)
import (
"github.com/yasuyuky/jsonpath"
)
// first you should decode string
data , err := jsonpath . DecodeString ( json_string )
// or io.Reader
data , err := jsonpath . DecodeReader ( json_reader )
// then you can get element using jsonpath.Get
// 1st arg is decoded data
// 2nd arg is path([]interfac