GetPath searches for the item as specified by the branch without the need to deep dive using Get()'s. js.GetPath("top_level", "dict")
(branch ...string)
| 132 | // |
| 133 | // js.GetPath("top_level", "dict") |
| 134 | func (j *Json) GetPath(branch ...string) *Json { |
| 135 | jin := j |
| 136 | for _, p := range branch { |
| 137 | jin = jin.Get(p) |
| 138 | } |
| 139 | return jin |
| 140 | } |
| 141 | |
| 142 | // GetIndex returns a pointer to a new `Json` object |
| 143 | // for `index` in its `array` representation |