MCPcopy
hub / github.com/uber-go/zap / AppendObject

Method AppendObject

zapcore/json_encoder.go:218–230  ·  view source on GitHub ↗
(obj ObjectMarshaler)

Source from the content-addressed store, hash-verified

216}
217
218func (enc *jsonEncoder) AppendObject(obj ObjectMarshaler) error {
219 // Close ONLY new openNamespaces that are created during
220 // AppendObject().
221 old := enc.openNamespaces
222 enc.openNamespaces = 0
223 enc.addElementSeparator()
224 enc.buf.AppendByte('{')
225 err := obj.MarshalLogObject(enc)
226 enc.buf.AppendByte('}')
227 enc.closeOpenNamespaces()
228 enc.openNamespaces = old
229 return err
230}
231
232func (enc *jsonEncoder) AppendBool(val bool) {
233 enc.addElementSeparator()

Callers 1

AddObjectMethod · 0.95

Calls 4

addElementSeparatorMethod · 0.95
closeOpenNamespacesMethod · 0.95
AppendByteMethod · 0.80
MarshalLogObjectMethod · 0.65

Tested by

no test coverage detected