Merge pull request #50 from go-redis/fix/upgrade-to-redis-2814

Fix PubSubNumSub to work with Redis 2.8.14.
This commit is contained in:
Vladimir Mihailenco 2014-11-06 13:17:51 +02:00
commit f790046fea
2 changed files with 3 additions and 3 deletions

View File

@ -1221,10 +1221,10 @@ func (c *Client) PubSubChannels(pattern string) *StringSliceCmd {
return cmd return cmd
} }
func (c *Client) PubSubNumSub(channels ...string) *StringSliceCmd { func (c *Client) PubSubNumSub(channels ...string) *SliceCmd {
args := []string{"PUBSUB", "NUMSUB"} args := []string{"PUBSUB", "NUMSUB"}
args = append(args, channels...) args = append(args, channels...)
cmd := NewStringSliceCmd(args...) cmd := NewSliceCmd(args...)
c.Process(cmd) c.Process(cmd)
return cmd return cmd
} }

View File

@ -2597,7 +2597,7 @@ func (t *RedisTest) TestPubSubNumSub(c *C) {
c.Assert( c.Assert(
channels, channels,
DeepEquals, DeepEquals,
[]string{"mychannel", "1", "mychannel2", "1", "mychannel3", "0"}, []interface{}{"mychannel", int64(1), "mychannel2", int64(1), "mychannel3", int64(0)},
) )
} }