Fix PubSubNumSub to work with Redis 2.8.14.

This commit is contained in:
Vladimir Mihailenco 2014-11-06 13:13:24 +02:00
parent 7b28e6f9d2
commit c54b831796
2 changed files with 3 additions and 3 deletions

View File

@ -1217,10 +1217,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

@ -2589,7 +2589,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)},
) )
} }