diff --git a/cluster.go b/cluster.go index 0e97da1..251214c 100644 --- a/cluster.go +++ b/cluster.go @@ -338,8 +338,6 @@ type ClusterClient struct { // Reports where slots reloading is in progress. reloading uint32 - - closed bool } // NewClusterClient returns a Redis Cluster client as described in diff --git a/commands_test.go b/commands_test.go index 5f060ec..a123133 100644 --- a/commands_test.go +++ b/commands_test.go @@ -2316,6 +2316,7 @@ var _ = Describe("Commands", func() { zAdd = client.ZAdd("zset", redis.Z{0, "b"}) Expect(zAdd.Err()).NotTo(HaveOccurred()) zAdd = client.ZAdd("zset", redis.Z{0, "c"}) + Expect(zAdd.Err()).NotTo(HaveOccurred()) zRangeByLex := client.ZRangeByLex("zset", redis.ZRangeBy{ Min: "-", diff --git a/internal/pool/pool.go b/internal/pool/pool.go index 47cedfa..1e5fac6 100644 --- a/internal/pool/pool.go +++ b/internal/pool/pool.go @@ -65,7 +65,6 @@ type ConnPool struct { stats Stats _closed int32 // atomic - lastErr atomic.Value } var _ Pooler = (*ConnPool)(nil) diff --git a/internal/proto/write_buffer.go b/internal/proto/write_buffer.go index 019e64c..096b6d7 100644 --- a/internal/proto/write_buffer.go +++ b/internal/proto/write_buffer.go @@ -6,8 +6,6 @@ import ( "strconv" ) -const bufferSize = 4096 - type WriteBuffer struct { b []byte } diff --git a/parser.go b/parser.go index ea73fb7..1d7ec63 100644 --- a/parser.go +++ b/parser.go @@ -30,19 +30,6 @@ func sliceParser(rd *proto.Reader, n int64) (interface{}, error) { return vals, nil } -// Implements proto.MultiBulkParse -func intSliceParser(rd *proto.Reader, n int64) (interface{}, error) { - ints := make([]int64, 0, n) - for i := int64(0); i < n; i++ { - n, err := rd.ReadIntReply() - if err != nil { - return nil, err - } - ints = append(ints, n) - } - return ints, nil -} - // Implements proto.MultiBulkParse func boolSliceParser(rd *proto.Reader, n int64) (interface{}, error) { bools := make([]bool, 0, n) @@ -72,19 +59,6 @@ func stringSliceParser(rd *proto.Reader, n int64) (interface{}, error) { return ss, nil } -// Implements proto.MultiBulkParse -func floatSliceParser(rd *proto.Reader, n int64) (interface{}, error) { - nn := make([]float64, 0, n) - for i := int64(0); i < n; i++ { - n, err := rd.ReadFloatReply() - if err != nil { - return nil, err - } - nn = append(nn, n) - } - return nn, nil -} - // Implements proto.MultiBulkParse func stringStringMapParser(rd *proto.Reader, n int64) (interface{}, error) { m := make(map[string]string, n/2) diff --git a/pubsub.go b/pubsub.go index d183c70..b90d727 100644 --- a/pubsub.go +++ b/pubsub.go @@ -3,7 +3,6 @@ package redis import ( "fmt" "net" - "sync" "time" "github.com/go-redis/redis/internal" @@ -17,7 +16,6 @@ type PubSub struct { base baseClient cmd *Cmd - mu sync.Mutex channels []string patterns []string } diff --git a/redis_test.go b/redis_test.go index 3f47e91..64cb2a4 100644 --- a/redis_test.go +++ b/redis_test.go @@ -59,6 +59,7 @@ var _ = Describe("Client", func() { It("should close pubsub without closing the client", func() { pubsub, err := client.Subscribe() + Expect(err).NotTo(HaveOccurred()) Expect(pubsub.Close()).NotTo(HaveOccurred()) _, err = pubsub.Receive() @@ -92,6 +93,7 @@ var _ = Describe("Client", func() { It("should close pubsub when client is closed", func() { pubsub, err := client.Subscribe() + Expect(err).NotTo(HaveOccurred()) Expect(client.Close()).NotTo(HaveOccurred()) _, err = pubsub.Receive()