ForEachLine iterates through lines of JSON as specified by the JSON Lines format (http://jsonlines.org/). Each line is returned as a GJSON Result.
(json string, iterator func(line Result) bool)
| 1900 | // format (http://jsonlines.org/). |
| 1901 | // Each line is returned as a GJSON Result. |
| 1902 | func ForEachLine(json string, iterator func(line Result) bool) { |
| 1903 | var res Result |
| 1904 | var i int |
| 1905 | for { |
| 1906 | i, res, _ = parseAny(json, i, true) |
| 1907 | if !res.Exists() { |
| 1908 | break |
| 1909 | } |
| 1910 | if !iterator(res) { |
| 1911 | return |
| 1912 | } |
| 1913 | } |
| 1914 | } |
| 1915 | |
| 1916 | type subSelector struct { |
| 1917 | name string |
searching dependent graphs…