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

Function Durationp

field.go:389–394  ·  view source on GitHub ↗

Durationp constructs a field that carries a *time.Duration. The returned Field will safely and explicitly represent `nil` when appropriate.

(key string, val *time.Duration)

Source from the content-addressed store, hash-verified

387// Durationp constructs a field that carries a *time.Duration. The returned Field will safely
388// and explicitly represent `nil` when appropriate.
389func Durationp(key string, val *time.Duration) Field {
390 if val == nil {
391 return nilField(key)
392 }
393 return Duration(key, *val)
394}
395
396// Object constructs a field with the given key and ObjectMarshaler. It
397// provides a flexible, but still type-safe and efficient, way to add map- or

Callers 1

TestFieldConstructorsFunction · 0.85

Calls 2

nilFieldFunction · 0.85
DurationFunction · 0.85

Tested by 1

TestFieldConstructorsFunction · 0.68