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

Function Duration

field.go:383–385  ·  field.go::Duration

Duration constructs a field with the given key and value. The encoder controls how the duration is serialized.

(key string, val time.Duration)

Source from the content-addressed store, hash-verified

381// Duration constructs a field with the given key and value. The encoder
382// controls how the duration is serialized.
383func Duration(key string, val time.Duration) Field {
384 return Field{Key: key, Type: zapcore.DurationType, Integer: int64(val)}
385}
386
387// Durationp constructs a field that carries a *time.Duration. The returned Field will safely
388// and explicitly represent `nil` when appropriate.

Callers 7

Example_presetsFunction · 0.92
ExampleDictObjectFunction · 0.92
TestJSONEmptyConfigFunction · 0.92
convertAttrToFieldFunction · 0.92
TestFieldConstructorsFunction · 0.85
BenchmarkDurationFieldFunction · 0.85
DurationpFunction · 0.85

Calls

no outgoing calls

Tested by 5

Example_presetsFunction · 0.74
ExampleDictObjectFunction · 0.74
TestJSONEmptyConfigFunction · 0.74
TestFieldConstructorsFunction · 0.68
BenchmarkDurationFieldFunction · 0.68