MCPcopy Create free account
hub / github.com/francoispqt/gojay / ObjectNull

Method ObjectNull

decode_object.go:392–407  ·  view source on GitHub ↗

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{})

Source from the content-addressed store, hash-verified

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.
392func (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}

Callers 3

AddObjectNullMethod · 0.95
UnmarshalJSONObjectMethod · 0.80
TestDecodeObjectNullFunction · 0.80

Calls 1

decodeObjectNullMethod · 0.95

Tested by 2

UnmarshalJSONObjectMethod · 0.64
TestDecodeObjectNullFunction · 0.64