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

Function Array

array.go:33–35  ·  view source on GitHub ↗

Array constructs a field with the given key and ArrayMarshaler. It provides a flexible, but still type-safe and efficient, way to add array-like types to the logging context. The struct's MarshalLogArray method is called lazily.

(key string, val zapcore.ArrayMarshaler)

Source from the content-addressed store, hash-verified

31// a flexible, but still type-safe and efficient, way to add array-like types
32// to the logging context. The struct's MarshalLogArray method is called lazily.
33func Array(key string, val zapcore.ArrayMarshaler) Field {
34 return Field{Key: key, Type: zapcore.ArrayMarshalerType, Interface: val}
35}
36
37// Bools constructs a field that carries a slice of bools.
38func Bools(key string, bs []bool) Field {

Callers 15

StrsFunction · 0.92
TestFieldConstructorsFunction · 0.92
fakeFieldsFunction · 0.92
TestFieldConstructorsFunction · 0.85
BoolsFunction · 0.85
ByteStringsFunction · 0.85
Complex128sFunction · 0.85
Complex64sFunction · 0.85
DurationsFunction · 0.85
Float64sFunction · 0.85
Float32sFunction · 0.85
IntsFunction · 0.85

Calls

no outgoing calls

Tested by 6

TestFieldConstructorsFunction · 0.74
fakeFieldsFunction · 0.74
TestFieldConstructorsFunction · 0.68
TestSugarWithFunction · 0.68
TestSugarWithCapturesFunction · 0.68
TestLoggerWithCapturesFunction · 0.68