diff --git a/model/commands.go b/model/commands.go index 937ff5d..53be09c 100644 --- a/model/commands.go +++ b/model/commands.go @@ -13,7 +13,7 @@ type Commands struct { Message string `db:"message" cc:"message"` Group string `db:"group" cc:"group"` Ctime time.Time `db:"ctime" cc:"ctime"` - Mtime time.Time `db:"mtime" cc:"ctime"` + Mtime time.Time `db:"mtime" cc:"mtime"` } // CommandsWithGroup - diff --git a/module/utils/utils.go b/module/utils/utils.go index 479934e..a5d3e6d 100644 --- a/module/utils/utils.go +++ b/module/utils/utils.go @@ -62,11 +62,16 @@ func ToMap(ss interface{}) map[string]interface{} { smap := make(map[string]interface{}) mtag := regexp.MustCompile(`cc:\"(.+)\"`) + re := regexp.MustCompile(`^[A-Z]`) + for i := 0; i < t.NumField(); i++ { f := t.Field(i) tag := string(t.Type().Field(i).Tag) str := mtag.FindStringSubmatch(tag) name := t.Type().Field(i).Name + if !re.Match([]byte(name)) { + continue + } leveling := false if len(str) > 1 { strArr := strings.Split(str[1], ",")