diff --git a/exists.go b/exists.go index 4985fe8..1007f1f 100644 --- a/exists.go +++ b/exists.go @@ -12,12 +12,3 @@ func Exist(key string) (bool, error) { return redisdb.Bool(c.Do("EXISTS", key)) } - -//hexists -func HExist(key string) (bool, error) { - c := GetConn() - defer c.Close() - - return redisdb.Bool(c.Do("HEXISTS", key)) - -} diff --git a/exists_test.go b/exists_test.go index 6b46f60..8442377 100644 --- a/exists_test.go +++ b/exists_test.go @@ -8,13 +8,10 @@ import ( func Test_Exists(t *testing.T) { - RedisInit("10.62.29.23:6379", "123456") + RedisInit("127.0.0.1:6379", "123456") - ret3, err := Exists("testing23") + ret3, err := Exists("60007_product2") t.Log(ret3) t.Log(err) - ret4, err := HExists("testing23", "cc") - t.Log(ret4) - t.Log(err) } diff --git a/hash_test.go b/hash_test.go index ed2b210..e95ab06 100644 --- a/hash_test.go +++ b/hash_test.go @@ -32,3 +32,10 @@ func Test_HMGet(t *testing.T) { t.Log(err) } + +func Test_HGetAll(t *testing.T) { + RedisPassword = "123456" + ret3, err := HGetAll("60007_user") + t.Log(ret3) + t.Log(err) +}