Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions pkg/types/converter.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ func Uint64ToString(num uint64) string {

// StringToInt 将字符串转换为 int
func StringToInt(str string) int {
if str == "" {
return 0
}
i, err := strconv.Atoi(str)
if err != nil {
logger.LogError(err)
Expand All @@ -26,6 +29,9 @@ func StringToInt(str string) int {

// Uint2String 将字符串转换为 int
func Uint2String(str string) int {
if str == "" {
return 0
}
i, err := strconv.Atoi(str)
if err != nil {
logger.LogError(err)
Expand Down