コード例 #1
0
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
	}
}
コード例 #2
0
// 重新加载
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
}