Map type asserts to `map`
()
| 176 | |
| 177 | // Map type asserts to `map` |
| 178 | func (j *Json) Map() (map[string]interface{}, error) { |
| 179 | if m, ok := (j.data).(map[string]interface{}); ok { |
| 180 | return m, nil |
| 181 | } |
| 182 | return nil, errors.New("type assertion to map[string]interface{} failed") |
| 183 | } |
| 184 | |
| 185 | // Array type asserts to an `array` |
| 186 | func (j *Json) Array() ([]interface{}, error) { |