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

Method AddObjectKeyOmitEmpty

encode_object.go:89–91  ·  view source on GitHub ↗

AddObjectKeyOmitEmpty adds an object to be encoded or skips it if IsNil returns true. Must be used inside a slice or array encoding (does not encode a key) value must implement MarshalerJSONObject

(key string, v MarshalerJSONObject)

Source from the content-addressed store, hash-verified

87// Must be used inside a slice or array encoding (does not encode a key)
88// value must implement MarshalerJSONObject
89func (enc *Encoder) AddObjectKeyOmitEmpty(key string, v MarshalerJSONObject) {
90 enc.ObjectKeyOmitEmpty(key, v)
91}
92
93// AddObjectKeyNullEmpty adds an object to be encoded or skips it if IsNil returns true.
94// Must be used inside a slice or array encoding (does not encode a key)

Callers 2

MarshalJSONObjectMethod · 0.80

Calls 1

ObjectKeyOmitEmptyMethod · 0.95

Tested by 1

MarshalJSONObjectMethod · 0.64