diff --git a/v2/parser.go b/v2/parser.go index 6d60b83..6c618dd 100644 --- a/v2/parser.go +++ b/v2/parser.go @@ -291,7 +291,6 @@ func _parseReply(rd reader, typ replyType) (interface{}, error) { } return vals, nil } - default: - return nil, fmt.Errorf("redis: can't parse %q", line) } + return nil, fmt.Errorf("redis: can't parse %q", line) } diff --git a/v2/pubsub.go b/v2/pubsub.go index 8d58854..99be619 100644 --- a/v2/pubsub.go +++ b/v2/pubsub.go @@ -62,7 +62,8 @@ func (c *PubSub) ReceiveTimeout(timeout time.Duration) (interface{}, error) { 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": return &Subscription{ Kind: msgName, @@ -80,9 +81,8 @@ func (c *PubSub) ReceiveTimeout(timeout time.Duration) (interface{}, error) { Channel: reply[2].(string), Payload: reply[3].(string), }, 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 {