pgtype Int fix minimum error message.
Previously on the minimum condition the error would be: "is greater than maximum" Also add encoding/json import into the .erb template as the import was missing after running rake generate.
This commit is contained in:
committed by
Jack Christensen
parent
e58381ac94
commit
1ce3e0384a
+3
-3
@@ -33,7 +33,7 @@ func (dst *Int2) ScanInt64(n Int8) error {
|
||||
}
|
||||
|
||||
if n.Int64 < math.MinInt16 {
|
||||
return fmt.Errorf("%d is greater than maximum value for Int2", n.Int64)
|
||||
return fmt.Errorf("%d is less than minimum value for Int2", n.Int64)
|
||||
}
|
||||
if n.Int64 > math.MaxInt16 {
|
||||
return fmt.Errorf("%d is greater than maximum value for Int2", n.Int64)
|
||||
@@ -593,7 +593,7 @@ func (dst *Int4) ScanInt64(n Int8) error {
|
||||
}
|
||||
|
||||
if n.Int64 < math.MinInt32 {
|
||||
return fmt.Errorf("%d is greater than maximum value for Int4", n.Int64)
|
||||
return fmt.Errorf("%d is less than minimum value for Int4", n.Int64)
|
||||
}
|
||||
if n.Int64 > math.MaxInt32 {
|
||||
return fmt.Errorf("%d is greater than maximum value for Int4", n.Int64)
|
||||
@@ -1164,7 +1164,7 @@ func (dst *Int8) ScanInt64(n Int8) error {
|
||||
}
|
||||
|
||||
if n.Int64 < math.MinInt64 {
|
||||
return fmt.Errorf("%d is greater than maximum value for Int8", n.Int64)
|
||||
return fmt.Errorf("%d is less than minimum value for Int8", n.Int64)
|
||||
}
|
||||
if n.Int64 > math.MaxInt64 {
|
||||
return fmt.Errorf("%d is greater than maximum value for Int8", n.Int64)
|
||||
|
||||
Reference in New Issue
Block a user