mirror of https://github.com/go-redis/redis.git
Change Z member to string (#2818)
This commit is contained in:
parent
1d784578df
commit
e535124055
|
@ -3722,28 +3722,28 @@ var _ = Describe("Commands", func() {
|
|||
It("should ZAdd bytes", func() {
|
||||
added, err := client.ZAdd(ctx, "zset", redis.Z{
|
||||
Score: 1,
|
||||
Member: []byte("one"),
|
||||
Member: "one",
|
||||
}).Result()
|
||||
Expect(err).NotTo(HaveOccurred())
|
||||
Expect(added).To(Equal(int64(1)))
|
||||
|
||||
added, err = client.ZAdd(ctx, "zset", redis.Z{
|
||||
Score: 1,
|
||||
Member: []byte("uno"),
|
||||
Member: "uno",
|
||||
}).Result()
|
||||
Expect(err).NotTo(HaveOccurred())
|
||||
Expect(added).To(Equal(int64(1)))
|
||||
|
||||
added, err = client.ZAdd(ctx, "zset", redis.Z{
|
||||
Score: 2,
|
||||
Member: []byte("two"),
|
||||
Member: "two",
|
||||
}).Result()
|
||||
Expect(err).NotTo(HaveOccurred())
|
||||
Expect(added).To(Equal(int64(1)))
|
||||
|
||||
added, err = client.ZAdd(ctx, "zset", redis.Z{
|
||||
Score: 3,
|
||||
Member: []byte("two"),
|
||||
Member: "two",
|
||||
}).Result()
|
||||
Expect(err).NotTo(HaveOccurred())
|
||||
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.
|
||||
type Z struct {
|
||||
Score float64
|
||||
Member interface{}
|
||||
Member string
|
||||
}
|
||||
|
||||
// ZWithKey represents sorted set member including the name of the key where it was popped.
|
||||
|
|
Loading…
Reference in New Issue