fix utils

This commit is contained in:
Jay
2018-04-24 17:49:58 +08:00
parent 1429c7fd85
commit 0a471443ce
8 changed files with 174 additions and 26 deletions
+4 -1
View File
@@ -7,7 +7,10 @@ import (
// ToMap struct to map[string]interface{}
func ToMap(ss interface{}) map[string]interface{} {
t := reflect.ValueOf(ss).Elem()
t := reflect.ValueOf(ss)
if t.Kind() == reflect.Ptr {
t = t.Elem()
}
smap := make(map[string]interface{})
mtag := regexp.MustCompile(`cc:\"(.+)\"`)