Skip to content

Commit

Permalink
Don't convert bytes to string in Cmd (interface{} value).
Browse files Browse the repository at this point in the history
  • Loading branch information
vmihailenco committed Apr 9, 2016
1 parent 1fbb109 commit 956758d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
8 changes: 1 addition & 7 deletions command.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down
2 changes: 1 addition & 1 deletion redis_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down

0 comments on commit 956758d

Please sign in to comment.