From 56ddaf11991c389c7c0119141926e900258760d0 Mon Sep 17 00:00:00 2001 From: Vladimir Mihailenco Date: Sat, 18 Feb 2017 15:42:12 +0200 Subject: [PATCH] Fix HMSet to accept interface{} value. --- commands.go | 4 ++-- commands_test.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/commands.go b/commands.go index bc93df9..21d5aa9 100644 --- a/commands.go +++ b/commands.go @@ -111,7 +111,7 @@ type Cmdable interface { HKeys(key string) *StringSliceCmd HLen(key string) *IntCmd 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 HSetNX(key, field string, value interface{}) *BoolCmd HVals(key string) *StringSliceCmd @@ -880,7 +880,7 @@ func (c *cmdable) HMGet(key string, fields ...string) *SliceCmd { 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[0] = "hmset" args[1] = key diff --git a/commands_test.go b/commands_test.go index a524aaf..2619186 100644 --- a/commands_test.go +++ b/commands_test.go @@ -1223,7 +1223,7 @@ var _ = Describe("Commands", func() { }) It("should HMSet", func() { - ok, err := client.HMSet("hash", map[string]string{ + ok, err := client.HMSet("hash", map[string]interface{}{ "key1": "hello1", "key2": "hello2", }).Result()