From 956758d3951b3440b5e757f0c180ae57d82c4f1b Mon Sep 17 00:00:00 2001 From: Vladimir Mihailenco Date: Sat, 9 Apr 2016 11:53:47 +0300 Subject: [PATCH] Don't convert bytes to string in Cmd (interface{} value). --- command.go | 8 +------- redis_test.go | 2 +- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/command.go b/command.go index 6681ff53..0c30bcb5 100644 --- a/command.go +++ b/command.go @@ -165,13 +165,7 @@ func (cmd *Cmd) readReply(cn *pool.Conn) error { cmd.err = err return cmd.err } - if v, ok := val.([]byte); ok { - // Convert to string to preserve old behaviour. - // TODO: remove in v4 - cmd.val = string(v) - } else { - cmd.val = val - } + cmd.val = val return nil } diff --git a/redis_test.go b/redis_test.go index fc0d702d..9d4a360f 100644 --- a/redis_test.go +++ b/redis_test.go @@ -132,7 +132,7 @@ var _ = Describe("Client", func() { cmd := redis.NewCmd("PING") client.Process(cmd) Expect(cmd.Err()).NotTo(HaveOccurred()) - Expect(cmd.Val()).To(Equal("PONG")) + Expect(cmd.Val()).To(Equal([]byte("PONG"))) }) It("should retry command on network error", func() {