1
0
mirror of https://github.com/redis/go-redis.git synced 2025-08-07 12:42:55 +03:00

internal/proto: cleanup bufio reader

This commit is contained in:
Vladimir Mihailenco
2018-08-05 15:07:10 +03:00
parent af03c6a149
commit c651b50db5
2 changed files with 15 additions and 32 deletions

View File

@@ -1,7 +1,6 @@
package proto
import (
"bufio"
"fmt"
"io"
"strconv"
@@ -54,13 +53,10 @@ func (r *Reader) ReadN(n int) ([]byte, error) {
}
func (r *Reader) ReadLine() ([]byte, error) {
line, isPrefix, err := r.src.ReadLine()
line, err := r.src.ReadLine()
if err != nil {
return nil, err
}
if isPrefix {
return nil, bufio.ErrBufferFull
}
if len(line) == 0 {
return nil, fmt.Errorf("redis: reply is empty")
}