File tree 1 file changed +10
-2
lines changed
1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -2579,18 +2579,26 @@ var _ = Describe("Commands", func() {
2579
2579
"val" ,
2580
2580
}))
2581
2581
2582
- type set2 struct {
2582
+ type setOmitEmpty struct {
2583
2583
Set1 string `redis:"set1"`
2584
2584
Set2 int `redis:"set2,omitempty"`
2585
2585
Set3 time.Duration `redis:"set3,omitempty"`
2586
2586
Set4 string `redis:"set4,omitempty"`
2587
2587
Set5 time.Time `redis:"set5,omitempty"`
2588
2588
}
2589
- hSet = client .HSet (ctx , "hash3" , & set2 {
2589
+ hSet = client .HSet (ctx , "hash3" , & setOmitEmpty {
2590
2590
Set1 : "val" ,
2591
2591
})
2592
2592
Expect (hSet .Err ()).NotTo (HaveOccurred ())
2593
2593
Expect (hSet .Val ()).To (Equal (int64 (1 )))
2594
+
2595
+ var dest setOmitEmpty
2596
+ hGetAll := client .HGetAll (ctx , "hash3" )
2597
+ Expect (hGetAll .Err ()).NotTo (HaveOccurred ())
2598
+ Expect (hGetAll .Val ()).To (Equal (map [string ]string {
2599
+ "set1" : "val" ,
2600
+ }))
2601
+ Expect (hGetAll .Scan (& dest )).NotTo (HaveOccurred ())
2594
2602
})
2595
2603
2596
2604
It ("should HSetNX" , func () {
You can’t perform that action at this time.
0 commit comments