aboutsummaryrefslogtreecommitdiff
path: root/src/bytes
diff options
context:
space:
mode:
Diffstat (limited to 'src/bytes')
-rw-r--r--src/bytes/buffer.go4
-rw-r--r--src/bytes/reader.go6
2 files changed, 5 insertions, 5 deletions
diff --git a/src/bytes/buffer.go b/src/bytes/buffer.go
index f135b46959..1aed86924d 100644
--- a/src/bytes/buffer.go
+++ b/src/bytes/buffer.go
@@ -293,14 +293,14 @@ func (b *Buffer) Next(n int) []byte {
// ReadByte reads and returns the next byte from the buffer.
// If no byte is available, it returns error io.EOF.
-func (b *Buffer) ReadByte() (c byte, err error) {
+func (b *Buffer) ReadByte() (byte, error) {
b.lastRead = opInvalid
if b.off >= len(b.buf) {
// Buffer is empty, reset to recover space.
b.Truncate(0)
return 0, io.EOF
}
- c = b.buf[b.off]
+ c := b.buf[b.off]
b.off++
b.lastRead = opRead
return c, nil
diff --git a/src/bytes/reader.go b/src/bytes/reader.go
index b89d1548f1..5941ebdab4 100644
--- a/src/bytes/reader.go
+++ b/src/bytes/reader.go
@@ -63,14 +63,14 @@ func (r *Reader) ReadAt(b []byte, off int64) (n int, err error) {
return
}
-func (r *Reader) ReadByte() (b byte, err error) {
+func (r *Reader) ReadByte() (byte, error) {
r.prevRune = -1
if r.i >= int64(len(r.s)) {
return 0, io.EOF
}
- b = r.s[r.i]
+ b := r.s[r.i]
r.i++
- return
+ return b, nil
}
func (r *Reader) UnreadByte() error {