fix bug of incr of cacl_utils.go

This commit is contained in:
AllenX2018 2020-12-12 18:02:59 +08:00
parent 404e3505b2
commit f6d5b8fe81

View File

@ -19,9 +19,9 @@ func incr(originVal interface{}) (interface{}, error) {
}
return val + 1, nil
case int64:
// if val == math.MaxInt64 {
// return nil, fmt.Errorf("increment would overflow")
// }
if val == math.MaxInt64 {
return nil, fmt.Errorf("increment would overflow")
}
return val + 1, nil
case uint:
tmp := val + 1