()
| 915 | } |
| 916 | |
| 917 | func ExampleJson_GetJsons() { |
| 918 | data := []byte(` |
| 919 | { |
| 920 | "users" : { |
| 921 | "count" : 3, |
| 922 | "array" : [{"Age":18,"Name":"John"}, {"Age":20,"Name":"Tom"}] |
| 923 | } |
| 924 | } |
| 925 | `) |
| 926 | |
| 927 | j, _ := gjson.LoadContent(data) |
| 928 | |
| 929 | jsons := j.GetJsons("users.array") |
| 930 | for _, json := range jsons { |
| 931 | fmt.Println(json.Interface()) |
| 932 | } |
| 933 | |
| 934 | // Output: |
| 935 | // map[Age:18 Name:John] |
| 936 | // map[Age:20 Name:Tom] |
| 937 | } |
| 938 | |
| 939 | func ExampleJson_GetJsonMap() { |
| 940 | data := []byte(` |
nothing calls this directly
no test coverage detected
searching dependent graphs…