mirror of https://github.com/go-redis/redis.git
Change Z Member type to interface (#2861)
This commit is contained in:
parent
a32be3d93d
commit
27581fcb43
|
@ -3733,28 +3733,28 @@ var _ = Describe("Commands", func() {
|
||||||
It("should ZAdd bytes", func() {
|
It("should ZAdd bytes", func() {
|
||||||
added, err := client.ZAdd(ctx, "zset", redis.Z{
|
added, err := client.ZAdd(ctx, "zset", redis.Z{
|
||||||
Score: 1,
|
Score: 1,
|
||||||
Member: "one",
|
Member: []byte("one"),
|
||||||
}).Result()
|
}).Result()
|
||||||
Expect(err).NotTo(HaveOccurred())
|
Expect(err).NotTo(HaveOccurred())
|
||||||
Expect(added).To(Equal(int64(1)))
|
Expect(added).To(Equal(int64(1)))
|
||||||
|
|
||||||
added, err = client.ZAdd(ctx, "zset", redis.Z{
|
added, err = client.ZAdd(ctx, "zset", redis.Z{
|
||||||
Score: 1,
|
Score: 1,
|
||||||
Member: "uno",
|
Member: []byte("uno"),
|
||||||
}).Result()
|
}).Result()
|
||||||
Expect(err).NotTo(HaveOccurred())
|
Expect(err).NotTo(HaveOccurred())
|
||||||
Expect(added).To(Equal(int64(1)))
|
Expect(added).To(Equal(int64(1)))
|
||||||
|
|
||||||
added, err = client.ZAdd(ctx, "zset", redis.Z{
|
added, err = client.ZAdd(ctx, "zset", redis.Z{
|
||||||
Score: 2,
|
Score: 2,
|
||||||
Member: "two",
|
Member: []byte("two"),
|
||||||
}).Result()
|
}).Result()
|
||||||
Expect(err).NotTo(HaveOccurred())
|
Expect(err).NotTo(HaveOccurred())
|
||||||
Expect(added).To(Equal(int64(1)))
|
Expect(added).To(Equal(int64(1)))
|
||||||
|
|
||||||
added, err = client.ZAdd(ctx, "zset", redis.Z{
|
added, err = client.ZAdd(ctx, "zset", redis.Z{
|
||||||
Score: 3,
|
Score: 3,
|
||||||
Member: "two",
|
Member: []byte("two"),
|
||||||
}).Result()
|
}).Result()
|
||||||
Expect(err).NotTo(HaveOccurred())
|
Expect(err).NotTo(HaveOccurred())
|
||||||
Expect(added).To(Equal(int64(0)))
|
Expect(added).To(Equal(int64(0)))
|
||||||
|
|
|
@ -727,7 +727,7 @@ func (c cmdable) ZScan(ctx context.Context, key string, cursor uint64, match str
|
||||||
// Z represents sorted set member.
|
// Z represents sorted set member.
|
||||||
type Z struct {
|
type Z struct {
|
||||||
Score float64
|
Score float64
|
||||||
Member string
|
Member interface{}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ZWithKey represents sorted set member including the name of the key where it was popped.
|
// ZWithKey represents sorted set member including the name of the key where it was popped.
|
||||||
|
|
Loading…
Reference in New Issue