forked from mirror/redis
Fix HMSet to accept interface{} value.
This commit is contained in:
parent
135cb12c76
commit
56ddaf1199
|
@ -111,7 +111,7 @@ type Cmdable interface {
|
||||||
HKeys(key string) *StringSliceCmd
|
HKeys(key string) *StringSliceCmd
|
||||||
HLen(key string) *IntCmd
|
HLen(key string) *IntCmd
|
||||||
HMGet(key string, fields ...string) *SliceCmd
|
HMGet(key string, fields ...string) *SliceCmd
|
||||||
HMSet(key string, fields map[string]string) *StatusCmd
|
HMSet(key string, fields map[string]interface{}) *StatusCmd
|
||||||
HSet(key, field string, value interface{}) *BoolCmd
|
HSet(key, field string, value interface{}) *BoolCmd
|
||||||
HSetNX(key, field string, value interface{}) *BoolCmd
|
HSetNX(key, field string, value interface{}) *BoolCmd
|
||||||
HVals(key string) *StringSliceCmd
|
HVals(key string) *StringSliceCmd
|
||||||
|
@ -880,7 +880,7 @@ func (c *cmdable) HMGet(key string, fields ...string) *SliceCmd {
|
||||||
return cmd
|
return cmd
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *cmdable) HMSet(key string, fields map[string]string) *StatusCmd {
|
func (c *cmdable) HMSet(key string, fields map[string]interface{}) *StatusCmd {
|
||||||
args := make([]interface{}, 2+len(fields)*2)
|
args := make([]interface{}, 2+len(fields)*2)
|
||||||
args[0] = "hmset"
|
args[0] = "hmset"
|
||||||
args[1] = key
|
args[1] = key
|
||||||
|
|
|
@ -1223,7 +1223,7 @@ var _ = Describe("Commands", func() {
|
||||||
})
|
})
|
||||||
|
|
||||||
It("should HMSet", func() {
|
It("should HMSet", func() {
|
||||||
ok, err := client.HMSet("hash", map[string]string{
|
ok, err := client.HMSet("hash", map[string]interface{}{
|
||||||
"key1": "hello1",
|
"key1": "hello1",
|
||||||
"key2": "hello2",
|
"key2": "hello2",
|
||||||
}).Result()
|
}).Result()
|
||||||
|
|
Loading…
Reference in New Issue