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

Remove internal errors package that clashes with std lib.

This commit is contained in:
Vladimir Mihailenco
2016-10-09 11:38:31 +00:00
parent 639950777c
commit 2c5b239ecb
9 changed files with 34 additions and 41 deletions

View File

@ -2,17 +2,16 @@ package proto
import (
"bufio"
"errors"
"fmt"
"io"
"strconv"
ierrors "gopkg.in/redis.v5/internal/errors"
"gopkg.in/redis.v5/internal"
)
type MultiBulkParse func(*Reader, int64) (interface{}, error)
const errEmptyReply = internal.RedisError("redis: reply is empty")
var errEmptyReply = errors.New("redis: reply is empty")
type MultiBulkParse func(*Reader, int64) (interface{}, error)
type Reader struct {
src *bufio.Reader
@ -59,7 +58,7 @@ func (p *Reader) ReadLine() ([]byte, error) {
return nil, errEmptyReply
}
if isNilReply(line) {
return nil, ierrors.Nil
return nil, internal.Nil
}
return line, nil
}
@ -209,7 +208,7 @@ func (p *Reader) ReadScanReply() ([]string, uint64, error) {
func (p *Reader) parseBytesValue(line []byte) ([]byte, error) {
if isNilReply(line) {
return nil, ierrors.Nil
return nil, internal.Nil
}
replyLen, err := strconv.Atoi(string(line[1:]))
@ -245,7 +244,7 @@ func isNilReply(b []byte) bool {
}
func parseErrorValue(line []byte) error {
return ierrors.RedisError(string(line[1:]))
return internal.RedisError(string(line[1:]))
}
func parseStatusValue(line []byte) ([]byte, error) {
@ -258,7 +257,7 @@ func parseIntValue(line []byte) (int64, error) {
func parseArrayLen(line []byte) (int64, error) {
if isNilReply(line) {
return 0, ierrors.Nil
return 0, internal.Nil
}
return parseIntValue(line)
}