Method
decodeJSONString
(tv string, rv reflect.Value)
Source from the content-addressed store, hash-verified
| 272 | } |
| 273 | |
| 274 | func (d *Decoder) decodeJSONString(tv string, rv reflect.Value) error { |
| 275 | switch rv.Kind() { |
| 276 | case reflect.String: |
| 277 | rv.SetString(tv) |
| 278 | case reflect.Interface: |
| 279 | // Ensure type aliasing is handled properly |
| 280 | rv.Set(reflect.ValueOf(tv).Convert(rv.Type())) |
| 281 | default: |
| 282 | return &document.UnmarshalTypeError{Value: "string", Type: rv.Type()} |
| 283 | } |
| 284 | |
| 285 | return nil |
| 286 | } |
| 287 | |
| 288 | func (d *Decoder) decodeJSONObject(tv map[string]interface{}, rv reflect.Value) error { |
| 289 | switch rv.Kind() { |
Tested by
no test coverage detected