Skip to content

Commit 9527245

Browse files
committed
Merge branch 'feat-decoder' of github.com:knadh/redis into feat-decoder
2 parents b358584 + f8a546b commit 9527245

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

commands_test.go

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1134,6 +1134,22 @@ var _ = Describe("Commands", func() {
11341134
Expect(mGet.Val()).To(Equal([]interface{}{"hello1", "hello2", nil}))
11351135
})
11361136

1137+
It("should scan Mget", func() {
1138+
err := client.MSet(ctx, "key1", "hello1", "key2", 123).Err()
1139+
Expect(err).NotTo(HaveOccurred())
1140+
1141+
res := client.MGet(ctx, "key1", "key2", "_")
1142+
Expect(res.Err()).NotTo(HaveOccurred())
1143+
1144+
type data struct {
1145+
Key1 string `redis:"key1"`
1146+
Key2 int `redis:"key2"`
1147+
}
1148+
var d data
1149+
Expect(res.Scan(&d)).NotTo(HaveOccurred())
1150+
Expect(d).To(Equal(data{Key1: "hello1", Key2: 123}))
1151+
})
1152+
11371153
It("should MSetNX", func() {
11381154
mSetNX := client.MSetNX(ctx, "key1", "hello1", "key2", "hello2")
11391155
Expect(mSetNX.Err()).NotTo(HaveOccurred())

0 commit comments

Comments
 (0)