func init() { if tmpList, err := sensitiveWordsDAL.GetSensitiveWordsList(); err != nil { panic(err) } else { sensitiveWordsList = tmpList } if tmpList, err := sensitiveWordsDAL.GetForbidWordsList(); err != nil { panic(err) } else { forbidWordsList = tmpList } }
// 重新加载 func Reload() error { if tmpList, err := sensitiveWordsDAL.GetSensitiveWordsList(); err != nil { return err } else { sensitiveWordsList = tmpList } if tmpList, err := sensitiveWordsDAL.GetForbidWordsList(); err != nil { return err } else { forbidWordsList = tmpList } return nil }