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

Method ReadBool

msgp/read.go:630–646  ·  view source on GitHub ↗

ReadBool reads a bool from the reader

()

Source from the content-addressed store, hash-verified

628
629// ReadBool reads a bool from the reader
630func (m *Reader) ReadBool() (b bool, err error) {
631 var p byte
632 p, err = m.R.PeekByte()
633 if err != nil {
634 return
635 }
636 switch p {
637 case mtrue:
638 b = true
639 case mfalse:
640 default:
641 err = badPrefix(BoolType, p)
642 return
643 }
644 _, err = m.R.Skip(1)
645 return
646}
647
648// ReadDuration reads a time.Duration from the reader
649func (m *Reader) ReadDuration() (d time.Duration, err error) {

Callers 3

FuzzReaderFunction · 0.95
ReadIntfMethod · 0.95
rwBoolFunction · 0.80

Calls 2

badPrefixFunction · 0.85
SkipMethod · 0.80

Tested by 1

FuzzReaderFunction · 0.76