添加日志

This commit is contained in:
eson
2023-11-23 17:20:39 +08:00
parent f9380df215
commit c53b5e8f7b
2 changed files with 13 additions and 0 deletions

View File

@@ -63,3 +63,13 @@ var checkModuleRe = regexp.MustCompile("[^\\.a-zA-Z_\\-0-9]")
func CheckModuleQuery(moduleQuery string) bool {
return !checkModuleRe.MatchString(moduleQuery)
}
// 检测数据的范围是否符合要求
func CheckValueRange[T comparable](v T, rangevalues ...T) bool {
for _, rv := range rangevalues {
if v == rv {
return true
}
}
return false
}