mirror of https://github.com/go-redis/redis.git
Go 1.0 compatibility.
This commit is contained in:
parent
10d639d255
commit
75c8dbf91d
|
@ -291,7 +291,6 @@ func _parseReply(rd reader, typ replyType) (interface{}, error) {
|
||||||
}
|
}
|
||||||
return vals, nil
|
return vals, nil
|
||||||
}
|
}
|
||||||
default:
|
|
||||||
return nil, fmt.Errorf("redis: can't parse %q", line)
|
|
||||||
}
|
}
|
||||||
|
return nil, fmt.Errorf("redis: can't parse %q", line)
|
||||||
}
|
}
|
||||||
|
|
|
@ -62,7 +62,8 @@ func (c *PubSub) ReceiveTimeout(timeout time.Duration) (interface{}, error) {
|
||||||
return nil, fmt.Errorf("redis: unexpected reply type %T", replyIface)
|
return nil, fmt.Errorf("redis: unexpected reply type %T", replyIface)
|
||||||
}
|
}
|
||||||
|
|
||||||
switch msgName := reply[0].(string); msgName {
|
msgName := reply[0].(string)
|
||||||
|
switch msgName {
|
||||||
case "subscribe", "unsubscribe", "psubscribe", "punsubscribe":
|
case "subscribe", "unsubscribe", "psubscribe", "punsubscribe":
|
||||||
return &Subscription{
|
return &Subscription{
|
||||||
Kind: msgName,
|
Kind: msgName,
|
||||||
|
@ -80,9 +81,8 @@ func (c *PubSub) ReceiveTimeout(timeout time.Duration) (interface{}, error) {
|
||||||
Channel: reply[2].(string),
|
Channel: reply[2].(string),
|
||||||
Payload: reply[3].(string),
|
Payload: reply[3].(string),
|
||||||
}, nil
|
}, nil
|
||||||
default:
|
|
||||||
return nil, fmt.Errorf("redis: unsupported message name: %q", msgName)
|
|
||||||
}
|
}
|
||||||
|
return nil, fmt.Errorf("redis: unsupported message name: %q", msgName)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *PubSub) subscribe(cmd string, channels ...string) error {
|
func (c *PubSub) subscribe(cmd string, channels ...string) error {
|
||||||
|
|
Loading…
Reference in New Issue