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

Method addKey

zapcore/json_encoder.go:444–453  ·  view source on GitHub ↗
(key string)

Source from the content-addressed store, hash-verified

442}
443
444func (enc *jsonEncoder) addKey(key string) {
445 enc.addElementSeparator()
446 enc.buf.AppendByte('"')
447 enc.safeAddString(key)
448 enc.buf.AppendByte('"')
449 enc.buf.AppendByte(':')
450 if enc.spaced {
451 enc.buf.AppendByte(' ')
452 }
453}
454
455func (enc *jsonEncoder) addElementSeparator() {
456 last := enc.buf.Len() - 1

Callers 15

AddArrayMethod · 0.95
AddObjectMethod · 0.95
AddByteStringMethod · 0.95
AddBoolMethod · 0.95
AddComplex128Method · 0.95
AddComplex64Method · 0.95
AddDurationMethod · 0.95
AddFloat64Method · 0.95
AddFloat32Method · 0.95
AddInt64Method · 0.95
AddReflectedMethod · 0.95
OpenNamespaceMethod · 0.95

Calls 3

addElementSeparatorMethod · 0.95
safeAddStringMethod · 0.95
AppendByteMethod · 0.80

Tested by

no test coverage detected