ObjectNull decodes the JSON value within an object or an array to a UnmarshalerJSONObject. v should be a pointer to an UnmarshalerJSONObject, if `null` value is encountered in JSON, it will leave the value v untouched, else it will create a new instance of the UnmarshalerJSONObject behind v.
(v interface{})
| 390 | // if `null` value is encountered in JSON, it will leave the value v untouched, |
| 391 | // else it will create a new instance of the UnmarshalerJSONObject behind v. |
| 392 | func (dec *Decoder) ObjectNull(v interface{}) error { |
| 393 | initialKeysDone := dec.keysDone |
| 394 | initialChild := dec.child |
| 395 | dec.keysDone = 0 |
| 396 | dec.called = 0 |
| 397 | dec.child |= 1 |
| 398 | newCursor, err := dec.decodeObjectNull(v) |
| 399 | if err != nil { |
| 400 | return err |
| 401 | } |
| 402 | dec.cursor = newCursor |
| 403 | dec.keysDone = initialKeysDone |
| 404 | dec.child = initialChild |
| 405 | dec.called |= 1 |
| 406 | return nil |
| 407 | } |