chore: fix id converter

This commit is contained in:
Steven
2023-10-28 09:04:32 +08:00
parent 2b7d7c95a5
commit 480c53d7a2
2 changed files with 6 additions and 5 deletions

View File

@@ -12,11 +12,11 @@ import (
// ConvertStringToInt32 converts a string to int32.
func ConvertStringToInt32(src string) (int32, error) {
i, err := strconv.Atoi(src)
parsed, err := strconv.ParseInt(src, 10, 32)
if err != nil {
return 0, err
}
return int32(i), nil
return int32(parsed), nil
}
// HasPrefixes returns true if the string s has any of the given prefixes.