Array returns back an array of values. If the result represents a null value or is non-existent, then an empty array will be returned. If the result is not a JSON array, the return value will be an array containing one result.
()
| 200 | // If the result is not a JSON array, the return value will be an |
| 201 | // array containing one result. |
| 202 | func (t Result) Array() []Result { |
| 203 | if t.Type == Null { |
| 204 | return []Result{} |
| 205 | } |
| 206 | if !t.IsArray() { |
| 207 | return []Result{t} |
| 208 | } |
| 209 | r := t.arrayOrMap('[', false) |
| 210 | return r.a |
| 211 | } |
| 212 | |
| 213 | // IsObject returns true if the result value is a JSON object. |
| 214 | func (t Result) IsObject() bool { |