Implemented gjson Example

1.SetSplitChar
This commit is contained in:
huangqian
2022-02-17 20:29:38 +08:00
parent f8f13bd905
commit 144249fcff
2 changed files with 48 additions and 21 deletions

View File

@ -32,27 +32,6 @@ func Example_patternGet() {
// John Score: 99.5
}
func Example_patternCustomSplitChar() {
data :=
`{
"users" : {
"count" : 2,
"list" : [
{"name" : "Ming", "score" : 60},
{"name" : "John", "score" : 99.5}
]
}
}`
if j, err := gjson.DecodeToJson(data); err != nil {
panic(err)
} else {
j.SetSplitChar('#')
fmt.Println("John Score:", j.Get("users#list#1#score").Float32())
}
// Output:
// John Score: 99.5
}
func Example_patternViolenceCheck() {
data :=
`{