gparse新增Remove方法,取消通过Set+nil来删除变量的方式

This commit is contained in:
John
2018-01-26 17:42:14 +08:00
parent e632ae7401
commit 03e100b4a5
3 changed files with 30 additions and 5 deletions

View File

@ -186,7 +186,18 @@ func convert() {
}
func remove1() {
p := gparser.New(map[string]string{
"k1" : "v1",
"k2" : "v2",
})
p.Set("0.0.0.0.0.0.0.0", []int{1,2,3})
p.Remove("0.0")
c, _ := p.ToJson()
fmt.Println(string(c))
}
func main() {
makeJson2()
//makeJson3()
remove1()
}