From 3996289fe27044d4666e1cda60ee16257fc6557c Mon Sep 17 00:00:00 2001 From: Vladimir Mihailenco Date: Fri, 14 Oct 2016 14:42:32 +0300 Subject: [PATCH] internal/proto: use read prefix to indicate that method reads from the stream. --- internal/proto/reader.go | 6 +++--- parser.go | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/internal/proto/reader.go b/internal/proto/reader.go index a98ddb6..84f1488 100644 --- a/internal/proto/reader.go +++ b/internal/proto/reader.go @@ -77,7 +77,7 @@ func (p *Reader) ReadReply(m MultiBulkParse) (interface{}, error) { case IntReply: return parseIntValue(line) case StringReply: - return p.parseBytesValue(line) + return p.readBytesValue(line) case ArrayReply: n, err := parseArrayLen(line) if err != nil { @@ -112,7 +112,7 @@ func (p *Reader) ReadBytesReply() ([]byte, error) { case ErrorReply: return nil, parseErrorValue(line) case StringReply: - return p.parseBytesValue(line) + return p.readBytesValue(line) case StatusReply: return parseStatusValue(line) default: @@ -206,7 +206,7 @@ func (p *Reader) ReadScanReply() ([]string, uint64, error) { return keys, cursor, err } -func (p *Reader) parseBytesValue(line []byte) ([]byte, error) { +func (p *Reader) readBytesValue(line []byte) ([]byte, error) { if isNilReply(line) { return nil, internal.Nil } diff --git a/parser.go b/parser.go index 578dbc9..10580ab 100644 --- a/parser.go +++ b/parser.go @@ -406,5 +406,5 @@ func timeParser(rd *proto.Reader, n int64) (interface{}, error) { return nil, err } - return time.Unix(sec, microsec*100), nil + return time.Unix(sec, microsec*1000), nil }