MCPcopy
hub / github.com/kubernetes/client-go / PrintResults

Method PrintResults

util/jsonpath/jsonpath.go:122–136  ·  view source on GitHub ↗

PrintResults writes the results into writer

(wr io.Writer, results []reflect.Value)

Source from the content-addressed store, hash-verified

120
121// PrintResults writes the results into writer
122func (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
139func (j *JSONPath) walk(value []reflect.Value, node Node) ([]reflect.Value, error) {

Callers 1

ExecuteMethod · 0.95

Calls 2

evalToTextMethod · 0.95
WriteMethod · 0.80

Tested by

no test coverage detected