mirror of
https://gitee.com/dromara/mayfly-go
synced 2026-02-16 09:15:39 +08:00
fix: sqlite数据问题时间类型问题修复等
This commit is contained in:
@@ -1,17 +0,0 @@
|
||||
package stringx
|
||||
|
||||
import (
|
||||
"strconv"
|
||||
)
|
||||
|
||||
// 将字符串值转为int值, 若value为空或者转换失败,则返回默认值
|
||||
func ConvInt(value string, defaultValue int) int {
|
||||
if value == "" {
|
||||
return defaultValue
|
||||
}
|
||||
if intV, err := strconv.Atoi(value); err != nil {
|
||||
return defaultValue
|
||||
} else {
|
||||
return intV
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user