From ce1ddaa30c8e603f1a396c0373d23be08a14c9cc Mon Sep 17 00:00:00 2001 From: Back Yu Date: Wed, 21 Dec 2016 01:03:12 +0800 Subject: [PATCH] Update commands.go Let HSet and HSetNX can use value as interface{} . --- commands.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/commands.go b/commands.go index 5132a59..89a70b6 100644 --- a/commands.go +++ b/commands.go @@ -109,8 +109,8 @@ type Cmdable interface { HLen(key string) *IntCmd HMGet(key string, fields ...string) *SliceCmd HMSet(key string, fields map[string]string) *StatusCmd - HSet(key, field, value string) *BoolCmd - HSetNX(key, field, value string) *BoolCmd + HSet(key, field string, value interface{}) *BoolCmd + HSetNX(key, field string, value interface{}) *BoolCmd HVals(key string) *StringSliceCmd BLPop(timeout time.Duration, keys ...string) *StringSliceCmd BRPop(timeout time.Duration, keys ...string) *StringSliceCmd @@ -892,13 +892,13 @@ func (c *cmdable) HMSet(key string, fields map[string]string) *StatusCmd { return cmd } -func (c *cmdable) HSet(key, field, value string) *BoolCmd { +func (c *cmdable) HSet(key, field string, value interface{}) *BoolCmd { cmd := NewBoolCmd("hset", key, field, value) c.process(cmd) return cmd } -func (c *cmdable) HSetNX(key, field, value string) *BoolCmd { +func (c *cmdable) HSetNX(key, field string, value interface{}) *BoolCmd { cmd := NewBoolCmd("hsetnx", key, field, value) c.process(cmd) return cmd