mirror of
https://github.com/jackc/pgx.git
synced 2025-05-25 17:00:21 +00:00
Fix error message for too big for int32
This commit is contained in:
parent
2a04433355
commit
4d4a45fc34
@ -652,22 +652,22 @@ func encodeInt4(w *WriteBuf, value interface{}) error {
|
||||
v = int32(value)
|
||||
case uint32:
|
||||
if value > math.MaxInt32 {
|
||||
return fmt.Errorf("%T %d is larger than max int64 %d", value, value, math.MaxInt32)
|
||||
return fmt.Errorf("%T %d is larger than max int32 %d", value, value, math.MaxInt32)
|
||||
}
|
||||
v = int32(value)
|
||||
case int64:
|
||||
if value > math.MaxInt32 {
|
||||
return fmt.Errorf("%T %d is larger than max int64 %d", value, value, math.MaxInt32)
|
||||
return fmt.Errorf("%T %d is larger than max int32 %d", value, value, math.MaxInt32)
|
||||
}
|
||||
v = int32(value)
|
||||
case uint64:
|
||||
if value > math.MaxInt32 {
|
||||
return fmt.Errorf("%T %d is larger than max int64 %d", value, value, math.MaxInt32)
|
||||
return fmt.Errorf("%T %d is larger than max int32 %d", value, value, math.MaxInt32)
|
||||
}
|
||||
v = int32(value)
|
||||
case int:
|
||||
if value > math.MaxInt32 {
|
||||
return fmt.Errorf("%T %d is larger than max int64 %d", value, value, math.MaxInt32)
|
||||
return fmt.Errorf("%T %d is larger than max int32 %d", value, value, math.MaxInt32)
|
||||
}
|
||||
v = int32(value)
|
||||
default:
|
||||
|
Loading…
x
Reference in New Issue
Block a user