summaryrefslogtreecommitdiffstats
path: root/vendor/github.com/go-redis/redis/parser.go
diff options
context:
space:
mode:
authorChristopher Speller <crspeller@gmail.com>2018-04-16 05:37:14 -0700
committerJoram Wilander <jwawilander@gmail.com>2018-04-16 08:37:14 -0400
commit6e2cb00008cbf09e556b00f87603797fcaa47e09 (patch)
tree3c0eb55ff4226a3f024aad373140d1fb860a6404 /vendor/github.com/go-redis/redis/parser.go
parentbf24f51c4e1cc6286885460672f7f449e8c6f5ef (diff)
downloadchat-6e2cb00008cbf09e556b00f87603797fcaa47e09.tar.gz
chat-6e2cb00008cbf09e556b00f87603797fcaa47e09.tar.bz2
chat-6e2cb00008cbf09e556b00f87603797fcaa47e09.zip
Depenancy upgrades and movign to dep. (#8630)
Diffstat (limited to 'vendor/github.com/go-redis/redis/parser.go')
-rw-r--r--vendor/github.com/go-redis/redis/parser.go26
1 files changed, 16 insertions, 10 deletions
diff --git a/vendor/github.com/go-redis/redis/parser.go b/vendor/github.com/go-redis/redis/parser.go
index b378abc4e..f0dc67f0e 100644
--- a/vendor/github.com/go-redis/redis/parser.go
+++ b/vendor/github.com/go-redis/redis/parser.go
@@ -14,17 +14,23 @@ func sliceParser(rd *proto.Reader, n int64) (interface{}, error) {
vals := make([]interface{}, 0, n)
for i := int64(0); i < n; i++ {
v, err := rd.ReadReply(sliceParser)
- if err == Nil {
- vals = append(vals, nil)
- } else if err != nil {
- return nil, err
- } else {
- switch vv := v.(type) {
- case []byte:
- vals = append(vals, string(vv))
- default:
- vals = append(vals, v)
+ if err != nil {
+ if err == Nil {
+ vals = append(vals, nil)
+ continue
+ }
+ if err, ok := err.(proto.RedisError); ok {
+ vals = append(vals, err)
+ continue
}
+ return nil, err
+ }
+
+ switch v := v.(type) {
+ case []byte:
+ vals = append(vals, string(v))
+ default:
+ vals = append(vals, v)
}
}
return vals, nil