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

Method AddArrayKeyOmitEmpty

encode_array.go:50–52  ·  view source on GitHub ↗

AddArrayKeyOmitEmpty adds an array or slice to be encoded and skips it if it is nil. Must be called inside an object as it will encode a key.

(key string, v MarshalerJSONArray)

Source from the content-addressed store, hash-verified

48// AddArrayKeyOmitEmpty adds an array or slice to be encoded and skips it if it is nil.
49// Must be called inside an object as it will encode a key.
50func (enc *Encoder) AddArrayKeyOmitEmpty(key string, v MarshalerJSONArray) {
51 enc.ArrayKeyOmitEmpty(key, v)
52}
53
54// AddArrayKeyNullEmpty adds an array or slice to be encoded and skips it if it is nil.
55// Must be called inside an object as it will encode a key. `null` will be encoded`

Callers 2

MarshalJSONObjectMethod · 0.80

Calls 1

ArrayKeyOmitEmptyMethod · 0.95

Tested by 1

MarshalJSONObjectMethod · 0.64