diff --git a/cluster.go b/cluster.go index 0e97da10..251214c1 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 5f060ecf..a1231334 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 47cedfa1..1e5fac6f 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 019e64c8..096b6d76 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 ea73fb78..1d7ec630 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 d183c70a..b90d7271 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 3f47e91e..64cb2a4f 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()