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

Function Float64

field.go:122–124  ·  view source on GitHub ↗

Float64 constructs a field that carries a float64. The way the floating-point value is represented is encoder-dependent, so marshaling is necessarily lazy.

(key string, val float64)

Source from the content-addressed store, hash-verified

120// floating-point value is represented is encoder-dependent, so marshaling is
121// necessarily lazy.
122func Float64(key string, val float64) Field {
123 return Field{Key: key, Type: zapcore.Float64Type, Integer: int64(math.Float64bits(val))}
124}
125
126// Float64p constructs a field that carries a *float64. The returned Field will safely
127// and explicitly represent `nil` when appropriate.

Callers 5

TestJSONEncodeEntryFunction · 0.92
convertAttrToFieldFunction · 0.92
TestFieldConstructorsFunction · 0.85
BenchmarkFloat64FieldFunction · 0.85
Float64pFunction · 0.85

Calls

no outgoing calls

Tested by 3

TestJSONEncodeEntryFunction · 0.74
TestFieldConstructorsFunction · 0.68
BenchmarkFloat64FieldFunction · 0.68