fix: 修复使用 int 和 math.MaxUint 比较导致溢出的问题

math.maxUint (untyped int constant 18446744073709551615) overflows int.
This commit is contained in:
kercylan98 2023-06-27 18:13:06 +08:00
parent 05a328e344
commit a4e9b5f143
1 changed files with 0 additions and 2 deletions

View File

@ -185,8 +185,6 @@ func withUintType(fieldValue string) any {
value, _ := strconv.Atoi(fieldValue) value, _ := strconv.Atoi(fieldValue)
if value < 0 { if value < 0 {
return uint(0) return uint(0)
} else if value > math.MaxUint {
return uint(math.MaxUint)
} }
return uint(value) return uint(value)
} }