io: rename Read/WriteBytes to Read/WriteB

go vet is not happy about them:
  pkg/io/binaryReader.go:92:21: method ReadByte() byte should have signature ReadByte() (byte, error)
  pkg/io/binaryWriter.go:75:21: method WriteByte(u8 byte) should have signature WriteByte(byte) error
This commit is contained in:
Roman Khimov 2019-12-12 20:17:50 +03:00
parent 0b14916d79
commit 8b3080b972
22 changed files with 70 additions and 70 deletions

View file

@ -87,9 +87,9 @@ func (r *BinReader) ReadU16BE() uint16 {
return binary.BigEndian.Uint16(r.u16)
}
// ReadByte reads a byte from the underlying io.Reader. On read failures it
// ReadB reads a byte from the underlying io.Reader. On read failures it
// returns zero.
func (r *BinReader) ReadByte() byte {
func (r *BinReader) ReadB() byte {
r.ReadBytes(r.u8)
if r.Err != nil {
return 0
@ -100,7 +100,7 @@ func (r *BinReader) ReadByte() byte {
// ReadBool reads a boolean value encoded in a zero/non-zero byte from the
// underlying io.Reader. On read failures it returns false.
func (r *BinReader) ReadBool() bool {
return r.ReadByte() != 0
return r.ReadB() != 0
}
// ReadArray reads array into value which must be
@ -169,7 +169,7 @@ func (r *BinReader) ReadVarUint() uint64 {
return 0
}
var b = r.ReadByte()
var b = r.ReadB()
if b == 0xfd {
return uint64(r.ReadU16LE())