fix: 修复使用 int 和 math.MaxUint 比较导致溢出的问题
math.maxUint (untyped int constant 18446744073709551615) overflows int.
This commit is contained in:
parent
05a328e344
commit
a4e9b5f143
|
@ -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)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue