解析device和task的配置全部用内置方法处理
This commit is contained in:
13
internal/infra/utils/validation.go
Normal file
13
internal/infra/utils/validation.go
Normal file
@@ -0,0 +1,13 @@
|
||||
package utils
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"strconv"
|
||||
)
|
||||
|
||||
// IsPureNumeric 检查值是否纯数字(整数或可转换为整数的字符串)。
|
||||
func IsPureNumeric(val interface{}) bool {
|
||||
v := fmt.Sprintf("%v", val)
|
||||
_, err := strconv.Atoi(v)
|
||||
return err == nil
|
||||
}
|
||||
Reference in New Issue
Block a user