PrintResults writes the results into writer
(wr io.Writer, results []reflect.Value)
| 120 | |
| 121 | // PrintResults writes the results into writer |
| 122 | func (j *JSONPath) PrintResults(wr io.Writer, results []reflect.Value) error { |
| 123 | for i, r := range results { |
| 124 | text, err := j.evalToText(r) |
| 125 | if err != nil { |
| 126 | return err |
| 127 | } |
| 128 | if i != len(results)-1 { |
| 129 | text = append(text, ' ') |
| 130 | } |
| 131 | if _, err = wr.Write(text); err != nil { |
| 132 | return err |
| 133 | } |
| 134 | } |
| 135 | return nil |
| 136 | } |
| 137 | |
| 138 | // walk visits tree rooted at the given node in DFS order |
| 139 | func (j *JSONPath) walk(value []reflect.Value, node Node) ([]reflect.Value, error) { |
no test coverage detected