Skip to content

Commit

Permalink
Remove useless checks
Browse files Browse the repository at this point in the history
  • Loading branch information
horpto authored and jackc committed Jul 31, 2023
1 parent 4556b71 commit 53c8e6e
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 12 deletions.
7 changes: 1 addition & 6 deletions convert.go
Original file line number Diff line number Diff line change
Expand Up @@ -240,12 +240,7 @@ func int64AssignTo(srcVal int64, srcStatus Status, dst interface{}) error {
}
*v = int32(srcVal)
case *int64:
if srcVal < math.MinInt64 {
return fmt.Errorf("%d is less than minimum value for int64", srcVal)
} else if srcVal > math.MaxInt64 {
return fmt.Errorf("%d is greater than maximum value for int64", srcVal)
}
*v = int64(srcVal)
*v = srcVal
case *uint:
if srcVal < 0 {
return fmt.Errorf("%d is less than zero for uint", srcVal)
Expand Down
6 changes: 0 additions & 6 deletions int8.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,6 @@ func (dst *Int8) Set(src interface{}) error {
}
*dst = Int8{Int: int64(value), Status: Present}
case int:
if int64(value) < math.MinInt64 {
return fmt.Errorf("%d is greater than maximum value for Int8", value)
}
if int64(value) > math.MaxInt64 {
return fmt.Errorf("%d is greater than maximum value for Int8", value)
}
*dst = Int8{Int: int64(value), Status: Present}
case uint:
if uint64(value) > math.MaxInt64 {
Expand Down

0 comments on commit 53c8e6e

Please sign in to comment.