mirror of https://github.com/go-redis/redis.git
Merge pull request #301 from go-redis/fix/cmd-bytes
Don't convert bytes to string in Cmd (interface{} value).
This commit is contained in:
commit
e11ad15978
|
@ -165,13 +165,7 @@ func (cmd *Cmd) readReply(cn *pool.Conn) error {
|
||||||
cmd.err = err
|
cmd.err = err
|
||||||
return cmd.err
|
return cmd.err
|
||||||
}
|
}
|
||||||
if v, ok := val.([]byte); ok {
|
cmd.val = val
|
||||||
// Convert to string to preserve old behaviour.
|
|
||||||
// TODO: remove in v4
|
|
||||||
cmd.val = string(v)
|
|
||||||
} else {
|
|
||||||
cmd.val = val
|
|
||||||
}
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -132,7 +132,7 @@ var _ = Describe("Client", func() {
|
||||||
cmd := redis.NewCmd("PING")
|
cmd := redis.NewCmd("PING")
|
||||||
client.Process(cmd)
|
client.Process(cmd)
|
||||||
Expect(cmd.Err()).NotTo(HaveOccurred())
|
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() {
|
It("should retry command on network error", func() {
|
||||||
|
|
Loading…
Reference in New Issue