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

Function Float32

field.go:138–140  ·  view source on GitHub ↗

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

(key string, val float32)

Source from the content-addressed store, hash-verified

136// floating-point value is represented is encoder-dependent, so marshaling is
137// necessarily lazy.
138func Float32(key string, val float32) Field {
139 return Field{Key: key, Type: zapcore.Float32Type, Integer: int64(math.Float32bits(val))}
140}
141
142// Float32p constructs a field that carries a *float32. The returned Field will safely
143// and explicitly represent `nil` when appropriate.

Callers 3

TestJSONEncodeEntryFunction · 0.92
TestFieldConstructorsFunction · 0.85
Float32pFunction · 0.85

Calls

no outgoing calls

Tested by 2

TestJSONEncodeEntryFunction · 0.74
TestFieldConstructorsFunction · 0.68