完成构建json基础类型的推荐

This commit is contained in:
2021-03-11 17:02:44 +08:00
parent 1f425c3973
commit 35041c9133
2 changed files with 80 additions and 12 deletions

View File

@ -15,6 +15,12 @@ import (
func TestJSON(t *testing.T) {
tree := NewDynamicJSON()
tree.SetValue("extra.height.value", 180)
tree.SetValue("extra.height.unit", "cm")
fmt.Println(tree.root)
tree.SetValue("extra.height.unit.use", "cm")
tree.SetValue("extra.height.unit.open", "1")
tree.SetValue("name", "zhangdeman")
tree.SetValue("good.name", "good")
tree.SetValue("work", "111")
tree.SetValue("good.price", "180")
tree.SetValue("good.unit", "$")
fmt.Println(tree.String())
}