chengjingtao / go-jsonv

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Description

Marshal or Unmarshal json or yaml value to nondeterministic go struct

How to use

func main() {
	var data = `
	{
		"name": "the-name",
		"value": [
			"1",
			true,
			{
				"key1": "1",
				"key2": 2
			}
		]
	}`

	type kv struct {
		Name  string
		Value jsonv.JsonV
	}

	m := kv{}
	json.Unmarshal([]byte(data), &m)
	fmt.Printf("%#v", m)
}

About


Languages

Language:Go 100.0%