renzheng 8 years ago
parent
commit
67a3ecf3a9

+ 1 - 0
common/src/github.com/docopt/docopt-go

@@ -0,0 +1 @@
+Subproject commit 784ddc588536785e7299f7272f39101f7faccc3f

+ 1 - 0
common/src/github.com/pkg/errors

@@ -0,0 +1 @@
+Subproject commit c605e284fe17294bda444b34710735b29d1a9d90

+ 7 - 4
common/src/qfw/util/redis/redisutil.go

@@ -214,7 +214,12 @@ func GetInt(code, key string) int {
 }
 
 //取得字符串,支持变参,2个 (key,code),返回后自己断言
-func Get(code, key string) interface{} {
+func Get(code, key string) (result interface{}) {
+	GetInterface(code, key, &result)
+	return
+}
+
+func GetInterface(code, key string, result interface{}) {
 	defer func() {
 		if r := recover(); r != nil {
 			log.Println("[E]", r)
@@ -231,17 +236,15 @@ func Get(code, key string) interface{} {
 	conn := RedisPool[code].Get()
 	defer conn.Close()
 	ret, err := conn.Do("GET", key)
-	var result interface{}
 	if nil != err {
 		log.Println("redisutil-GetError", err)
 	} else {
 		var ok bool
 		var res []byte
 		if res, ok = ret.([]byte); ok {
-			err = json.Unmarshal(res, &result)
+			err = json.Unmarshal(res, result)
 		}
 	}
-	return result
 }
 
 //直接返回字节流