MCPcopy
hub / github.com/tinylib/msgp / ReadFloat32

Method ReadFloat32

msgp/read.go:614–627  ·  view source on GitHub ↗

ReadFloat32 reads a float32 from the reader

()

Source from the content-addressed store, hash-verified

612
613// ReadFloat32 reads a float32 from the reader
614func (m *Reader) ReadFloat32() (f float32, err error) {
615 var p []byte
616 p, err = m.R.Peek(5)
617 if err != nil {
618 return
619 }
620 if p[0] != mfloat32 {
621 err = badPrefix(Float32Type, p[0])
622 return
623 }
624 f = math.Float32frombits(getMuint32(p))
625 _, err = m.R.Skip(5)
626 return
627}
628
629// ReadBool reads a bool from the reader
630func (m *Reader) ReadBool() (b bool, err error) {

Callers 9

TestReadFloat32Function · 0.95
BenchmarkReadFloat32Function · 0.95
FuzzReaderFunction · 0.95
ReadFloat64Method · 0.95
ReadIntfMethod · 0.95
DecodeMsgMethod · 0.80
rwFloat32Function · 0.80
DecodeMsgMethod · 0.80
DecodeMsgMethod · 0.80

Calls 3

badPrefixFunction · 0.85
getMuint32Function · 0.85
SkipMethod · 0.80

Tested by 3

TestReadFloat32Function · 0.76
BenchmarkReadFloat32Function · 0.76
FuzzReaderFunction · 0.76