From 3dd0183efd72004614901cff01952e032e985233 Mon Sep 17 00:00:00 2001 From: shoopea Date: Wed, 8 May 2019 19:12:30 +0800 Subject: [PATCH] test --- sql.go | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/sql.go b/sql.go index 04127ff..7677347 100644 --- a/sql.go +++ b/sql.go @@ -279,7 +279,7 @@ func insertMsgReport(objId int64, war_date int32, atk int32, def int32, exp int3 return nil } -func loadMsgParsingRules() (map[int]MessageParsingRule, error) { +func loadMsgParsingRules() (m map[int]MessageParsingRule, err error) { var ( id int32 priority int32 @@ -289,13 +289,12 @@ func loadMsgParsingRules() (map[int]MessageParsingRule, error) { ) log.Println("Loading message parsing rules...") - m := make(map[int]MessageParsingRule) + m = make(map[int]MessageParsingRule) count := int(0) defer func() { if rec := recover(); rec != nil { - log.Printf("loadMsgParsingRules : panic %s \n", rec) - return + err := errors.New(rec) } }() @@ -316,10 +315,8 @@ func loadMsgParsingRules() (map[int]MessageParsingRule, error) { i.Description = descn i.Rule = rule i.MsgTypeID = msgTypeID - i.re = regexp.MustCompile(rule) m[count] = *i count++ - } return m, nil