2
0

Standardize casing for NULL in error messages

This commit is contained in:
Jack Christensen
2022-08-22 20:58:22 -05:00
parent 2e73d1e8ee
commit fe3a4f3150
13 changed files with 69 additions and 69 deletions
+2 -2
View File
@@ -240,7 +240,7 @@ type scanPlanBinaryBoolToBool struct{}
func (scanPlanBinaryBoolToBool) Scan(src []byte, dst any) error {
if src == nil {
return fmt.Errorf("cannot scan null into %T", dst)
return fmt.Errorf("cannot scan NULL into %T", dst)
}
if len(src) != 1 {
@@ -261,7 +261,7 @@ type scanPlanTextAnyToBool struct{}
func (scanPlanTextAnyToBool) Scan(src []byte, dst any) error {
if src == nil {
return fmt.Errorf("cannot scan null into %T", dst)
return fmt.Errorf("cannot scan NULL into %T", dst)
}
if len(src) != 1 {
+1 -1
View File
@@ -85,7 +85,7 @@ type scanPlanTextAnyToEnumString struct {
func (plan *scanPlanTextAnyToEnumString) Scan(src []byte, dst any) error {
if src == nil {
return fmt.Errorf("cannot scan null into %T", dst)
return fmt.Errorf("cannot scan NULL into %T", dst)
}
p := (dst).(*string)
+2 -2
View File
@@ -177,7 +177,7 @@ type scanPlanBinaryFloat4ToFloat32 struct{}
func (scanPlanBinaryFloat4ToFloat32) Scan(src []byte, dst any) error {
if src == nil {
return fmt.Errorf("cannot scan null into %T", dst)
return fmt.Errorf("cannot scan NULL into %T", dst)
}
if len(src) != 4 {
@@ -254,7 +254,7 @@ type scanPlanTextAnyToFloat32 struct{}
func (scanPlanTextAnyToFloat32) Scan(src []byte, dst any) error {
if src == nil {
return fmt.Errorf("cannot scan null into %T", dst)
return fmt.Errorf("cannot scan NULL into %T", dst)
}
n, err := strconv.ParseFloat(string(src), 32)
+2 -2
View File
@@ -215,7 +215,7 @@ type scanPlanBinaryFloat8ToFloat64 struct{}
func (scanPlanBinaryFloat8ToFloat64) Scan(src []byte, dst any) error {
if src == nil {
return fmt.Errorf("cannot scan null into %T", dst)
return fmt.Errorf("cannot scan NULL into %T", dst)
}
if len(src) != 8 {
@@ -292,7 +292,7 @@ type scanPlanTextAnyToFloat64 struct{}
func (scanPlanTextAnyToFloat64) Scan(src []byte, dst any) error {
if src == nil {
return fmt.Errorf("cannot scan null into %T", dst)
return fmt.Errorf("cannot scan NULL into %T", dst)
}
n, err := strconv.ParseFloat(string(src), 64)
+40 -40
View File
@@ -296,7 +296,7 @@ type scanPlanBinaryInt2ToInt8 struct{}
func (scanPlanBinaryInt2ToInt8) Scan(src []byte, dst any) error {
if src == nil {
return fmt.Errorf("cannot scan null into %T", dst)
return fmt.Errorf("cannot scan NULL into %T", dst)
}
if len(src) != 2 {
@@ -324,7 +324,7 @@ type scanPlanBinaryInt2ToUint8 struct{}
func (scanPlanBinaryInt2ToUint8) Scan(src []byte, dst any) error {
if src == nil {
return fmt.Errorf("cannot scan null into %T", dst)
return fmt.Errorf("cannot scan NULL into %T", dst)
}
if len(src) != 2 {
@@ -354,7 +354,7 @@ type scanPlanBinaryInt2ToInt16 struct{}
func (scanPlanBinaryInt2ToInt16) Scan(src []byte, dst any) error {
if src == nil {
return fmt.Errorf("cannot scan null into %T", dst)
return fmt.Errorf("cannot scan NULL into %T", dst)
}
if len(src) != 2 {
@@ -375,7 +375,7 @@ type scanPlanBinaryInt2ToUint16 struct{}
func (scanPlanBinaryInt2ToUint16) Scan(src []byte, dst any) error {
if src == nil {
return fmt.Errorf("cannot scan null into %T", dst)
return fmt.Errorf("cannot scan NULL into %T", dst)
}
if len(src) != 2 {
@@ -401,7 +401,7 @@ type scanPlanBinaryInt2ToInt32 struct{}
func (scanPlanBinaryInt2ToInt32) Scan(src []byte, dst any) error {
if src == nil {
return fmt.Errorf("cannot scan null into %T", dst)
return fmt.Errorf("cannot scan NULL into %T", dst)
}
if len(src) != 2 {
@@ -422,7 +422,7 @@ type scanPlanBinaryInt2ToUint32 struct{}
func (scanPlanBinaryInt2ToUint32) Scan(src []byte, dst any) error {
if src == nil {
return fmt.Errorf("cannot scan null into %T", dst)
return fmt.Errorf("cannot scan NULL into %T", dst)
}
if len(src) != 2 {
@@ -448,7 +448,7 @@ type scanPlanBinaryInt2ToInt64 struct{}
func (scanPlanBinaryInt2ToInt64) Scan(src []byte, dst any) error {
if src == nil {
return fmt.Errorf("cannot scan null into %T", dst)
return fmt.Errorf("cannot scan NULL into %T", dst)
}
if len(src) != 2 {
@@ -469,7 +469,7 @@ type scanPlanBinaryInt2ToUint64 struct{}
func (scanPlanBinaryInt2ToUint64) Scan(src []byte, dst any) error {
if src == nil {
return fmt.Errorf("cannot scan null into %T", dst)
return fmt.Errorf("cannot scan NULL into %T", dst)
}
if len(src) != 2 {
@@ -495,7 +495,7 @@ type scanPlanBinaryInt2ToInt struct{}
func (scanPlanBinaryInt2ToInt) Scan(src []byte, dst any) error {
if src == nil {
return fmt.Errorf("cannot scan null into %T", dst)
return fmt.Errorf("cannot scan NULL into %T", dst)
}
if len(src) != 2 {
@@ -516,7 +516,7 @@ type scanPlanBinaryInt2ToUint struct{}
func (scanPlanBinaryInt2ToUint) Scan(src []byte, dst any) error {
if src == nil {
return fmt.Errorf("cannot scan null into %T", dst)
return fmt.Errorf("cannot scan NULL into %T", dst)
}
if len(src) != 2 {
@@ -856,7 +856,7 @@ type scanPlanBinaryInt4ToInt8 struct{}
func (scanPlanBinaryInt4ToInt8) Scan(src []byte, dst any) error {
if src == nil {
return fmt.Errorf("cannot scan null into %T", dst)
return fmt.Errorf("cannot scan NULL into %T", dst)
}
if len(src) != 4 {
@@ -884,7 +884,7 @@ type scanPlanBinaryInt4ToUint8 struct{}
func (scanPlanBinaryInt4ToUint8) Scan(src []byte, dst any) error {
if src == nil {
return fmt.Errorf("cannot scan null into %T", dst)
return fmt.Errorf("cannot scan NULL into %T", dst)
}
if len(src) != 4 {
@@ -914,7 +914,7 @@ type scanPlanBinaryInt4ToInt16 struct{}
func (scanPlanBinaryInt4ToInt16) Scan(src []byte, dst any) error {
if src == nil {
return fmt.Errorf("cannot scan null into %T", dst)
return fmt.Errorf("cannot scan NULL into %T", dst)
}
if len(src) != 4 {
@@ -942,7 +942,7 @@ type scanPlanBinaryInt4ToUint16 struct{}
func (scanPlanBinaryInt4ToUint16) Scan(src []byte, dst any) error {
if src == nil {
return fmt.Errorf("cannot scan null into %T", dst)
return fmt.Errorf("cannot scan NULL into %T", dst)
}
if len(src) != 4 {
@@ -972,7 +972,7 @@ type scanPlanBinaryInt4ToInt32 struct{}
func (scanPlanBinaryInt4ToInt32) Scan(src []byte, dst any) error {
if src == nil {
return fmt.Errorf("cannot scan null into %T", dst)
return fmt.Errorf("cannot scan NULL into %T", dst)
}
if len(src) != 4 {
@@ -993,7 +993,7 @@ type scanPlanBinaryInt4ToUint32 struct{}
func (scanPlanBinaryInt4ToUint32) Scan(src []byte, dst any) error {
if src == nil {
return fmt.Errorf("cannot scan null into %T", dst)
return fmt.Errorf("cannot scan NULL into %T", dst)
}
if len(src) != 4 {
@@ -1019,7 +1019,7 @@ type scanPlanBinaryInt4ToInt64 struct{}
func (scanPlanBinaryInt4ToInt64) Scan(src []byte, dst any) error {
if src == nil {
return fmt.Errorf("cannot scan null into %T", dst)
return fmt.Errorf("cannot scan NULL into %T", dst)
}
if len(src) != 4 {
@@ -1040,7 +1040,7 @@ type scanPlanBinaryInt4ToUint64 struct{}
func (scanPlanBinaryInt4ToUint64) Scan(src []byte, dst any) error {
if src == nil {
return fmt.Errorf("cannot scan null into %T", dst)
return fmt.Errorf("cannot scan NULL into %T", dst)
}
if len(src) != 4 {
@@ -1066,7 +1066,7 @@ type scanPlanBinaryInt4ToInt struct{}
func (scanPlanBinaryInt4ToInt) Scan(src []byte, dst any) error {
if src == nil {
return fmt.Errorf("cannot scan null into %T", dst)
return fmt.Errorf("cannot scan NULL into %T", dst)
}
if len(src) != 4 {
@@ -1087,7 +1087,7 @@ type scanPlanBinaryInt4ToUint struct{}
func (scanPlanBinaryInt4ToUint) Scan(src []byte, dst any) error {
if src == nil {
return fmt.Errorf("cannot scan null into %T", dst)
return fmt.Errorf("cannot scan NULL into %T", dst)
}
if len(src) != 4 {
@@ -1427,7 +1427,7 @@ type scanPlanBinaryInt8ToInt8 struct{}
func (scanPlanBinaryInt8ToInt8) Scan(src []byte, dst any) error {
if src == nil {
return fmt.Errorf("cannot scan null into %T", dst)
return fmt.Errorf("cannot scan NULL into %T", dst)
}
if len(src) != 8 {
@@ -1455,7 +1455,7 @@ type scanPlanBinaryInt8ToUint8 struct{}
func (scanPlanBinaryInt8ToUint8) Scan(src []byte, dst any) error {
if src == nil {
return fmt.Errorf("cannot scan null into %T", dst)
return fmt.Errorf("cannot scan NULL into %T", dst)
}
if len(src) != 8 {
@@ -1485,7 +1485,7 @@ type scanPlanBinaryInt8ToInt16 struct{}
func (scanPlanBinaryInt8ToInt16) Scan(src []byte, dst any) error {
if src == nil {
return fmt.Errorf("cannot scan null into %T", dst)
return fmt.Errorf("cannot scan NULL into %T", dst)
}
if len(src) != 8 {
@@ -1513,7 +1513,7 @@ type scanPlanBinaryInt8ToUint16 struct{}
func (scanPlanBinaryInt8ToUint16) Scan(src []byte, dst any) error {
if src == nil {
return fmt.Errorf("cannot scan null into %T", dst)
return fmt.Errorf("cannot scan NULL into %T", dst)
}
if len(src) != 8 {
@@ -1543,7 +1543,7 @@ type scanPlanBinaryInt8ToInt32 struct{}
func (scanPlanBinaryInt8ToInt32) Scan(src []byte, dst any) error {
if src == nil {
return fmt.Errorf("cannot scan null into %T", dst)
return fmt.Errorf("cannot scan NULL into %T", dst)
}
if len(src) != 8 {
@@ -1571,7 +1571,7 @@ type scanPlanBinaryInt8ToUint32 struct{}
func (scanPlanBinaryInt8ToUint32) Scan(src []byte, dst any) error {
if src == nil {
return fmt.Errorf("cannot scan null into %T", dst)
return fmt.Errorf("cannot scan NULL into %T", dst)
}
if len(src) != 8 {
@@ -1601,7 +1601,7 @@ type scanPlanBinaryInt8ToInt64 struct{}
func (scanPlanBinaryInt8ToInt64) Scan(src []byte, dst any) error {
if src == nil {
return fmt.Errorf("cannot scan null into %T", dst)
return fmt.Errorf("cannot scan NULL into %T", dst)
}
if len(src) != 8 {
@@ -1622,7 +1622,7 @@ type scanPlanBinaryInt8ToUint64 struct{}
func (scanPlanBinaryInt8ToUint64) Scan(src []byte, dst any) error {
if src == nil {
return fmt.Errorf("cannot scan null into %T", dst)
return fmt.Errorf("cannot scan NULL into %T", dst)
}
if len(src) != 8 {
@@ -1648,7 +1648,7 @@ type scanPlanBinaryInt8ToInt struct{}
func (scanPlanBinaryInt8ToInt) Scan(src []byte, dst any) error {
if src == nil {
return fmt.Errorf("cannot scan null into %T", dst)
return fmt.Errorf("cannot scan NULL into %T", dst)
}
if len(src) != 8 {
@@ -1676,7 +1676,7 @@ type scanPlanBinaryInt8ToUint struct{}
func (scanPlanBinaryInt8ToUint) Scan(src []byte, dst any) error {
if src == nil {
return fmt.Errorf("cannot scan null into %T", dst)
return fmt.Errorf("cannot scan NULL into %T", dst)
}
if len(src) != 8 {
@@ -1748,7 +1748,7 @@ type scanPlanTextAnyToInt8 struct{}
func (scanPlanTextAnyToInt8) Scan(src []byte, dst any) error {
if src == nil {
return fmt.Errorf("cannot scan null into %T", dst)
return fmt.Errorf("cannot scan NULL into %T", dst)
}
p, ok := (dst).(*int8)
@@ -1769,7 +1769,7 @@ type scanPlanTextAnyToUint8 struct{}
func (scanPlanTextAnyToUint8) Scan(src []byte, dst any) error {
if src == nil {
return fmt.Errorf("cannot scan null into %T", dst)
return fmt.Errorf("cannot scan NULL into %T", dst)
}
p, ok := (dst).(*uint8)
@@ -1790,7 +1790,7 @@ type scanPlanTextAnyToInt16 struct{}
func (scanPlanTextAnyToInt16) Scan(src []byte, dst any) error {
if src == nil {
return fmt.Errorf("cannot scan null into %T", dst)
return fmt.Errorf("cannot scan NULL into %T", dst)
}
p, ok := (dst).(*int16)
@@ -1811,7 +1811,7 @@ type scanPlanTextAnyToUint16 struct{}
func (scanPlanTextAnyToUint16) Scan(src []byte, dst any) error {
if src == nil {
return fmt.Errorf("cannot scan null into %T", dst)
return fmt.Errorf("cannot scan NULL into %T", dst)
}
p, ok := (dst).(*uint16)
@@ -1832,7 +1832,7 @@ type scanPlanTextAnyToInt32 struct{}
func (scanPlanTextAnyToInt32) Scan(src []byte, dst any) error {
if src == nil {
return fmt.Errorf("cannot scan null into %T", dst)
return fmt.Errorf("cannot scan NULL into %T", dst)
}
p, ok := (dst).(*int32)
@@ -1853,7 +1853,7 @@ type scanPlanTextAnyToUint32 struct{}
func (scanPlanTextAnyToUint32) Scan(src []byte, dst any) error {
if src == nil {
return fmt.Errorf("cannot scan null into %T", dst)
return fmt.Errorf("cannot scan NULL into %T", dst)
}
p, ok := (dst).(*uint32)
@@ -1874,7 +1874,7 @@ type scanPlanTextAnyToInt64 struct{}
func (scanPlanTextAnyToInt64) Scan(src []byte, dst any) error {
if src == nil {
return fmt.Errorf("cannot scan null into %T", dst)
return fmt.Errorf("cannot scan NULL into %T", dst)
}
p, ok := (dst).(*int64)
@@ -1895,7 +1895,7 @@ type scanPlanTextAnyToUint64 struct{}
func (scanPlanTextAnyToUint64) Scan(src []byte, dst any) error {
if src == nil {
return fmt.Errorf("cannot scan null into %T", dst)
return fmt.Errorf("cannot scan NULL into %T", dst)
}
p, ok := (dst).(*uint64)
@@ -1916,7 +1916,7 @@ type scanPlanTextAnyToInt struct{}
func (scanPlanTextAnyToInt) Scan(src []byte, dst any) error {
if src == nil {
return fmt.Errorf("cannot scan null into %T", dst)
return fmt.Errorf("cannot scan NULL into %T", dst)
}
p, ok := (dst).(*int)
@@ -1937,7 +1937,7 @@ type scanPlanTextAnyToUint struct{}
func (scanPlanTextAnyToUint) Scan(src []byte, dst any) error {
if src == nil {
return fmt.Errorf("cannot scan null into %T", dst)
return fmt.Errorf("cannot scan NULL into %T", dst)
}
p, ok := (dst).(*uint)
+6 -6
View File
@@ -299,7 +299,7 @@ type scanPlanBinaryInt<%= pg_byte_size %>ToInt<%= dst_bit_size %> struct{}
func (scanPlanBinaryInt<%= pg_byte_size %>ToInt<%= dst_bit_size %>) Scan(src []byte, dst any) error {
if src == nil {
return fmt.Errorf("cannot scan null into %T", dst)
return fmt.Errorf("cannot scan NULL into %T", dst)
}
if len(src) != <%= pg_byte_size %> {
@@ -333,7 +333,7 @@ type scanPlanBinaryInt<%= pg_byte_size %>ToUint<%= dst_bit_size %> struct{}
func (scanPlanBinaryInt<%= pg_byte_size %>ToUint<%= dst_bit_size %>) Scan(src []byte, dst any) error {
if src == nil {
return fmt.Errorf("cannot scan null into %T", dst)
return fmt.Errorf("cannot scan NULL into %T", dst)
}
if len(src) != <%= pg_byte_size %> {
@@ -365,7 +365,7 @@ type scanPlanBinaryInt<%= pg_byte_size %>ToInt struct{}
func (scanPlanBinaryInt<%= pg_byte_size %>ToInt) Scan(src []byte, dst any) error {
if src == nil {
return fmt.Errorf("cannot scan null into %T", dst)
return fmt.Errorf("cannot scan NULL into %T", dst)
}
if len(src) != <%= pg_byte_size %> {
@@ -397,7 +397,7 @@ type scanPlanBinaryInt<%= pg_byte_size %>ToUint struct{}
func (scanPlanBinaryInt<%= pg_byte_size %>ToUint) Scan(src []byte, dst any) error {
if src == nil {
return fmt.Errorf("cannot scan null into %T", dst)
return fmt.Errorf("cannot scan NULL into %T", dst)
}
if len(src) != <%= pg_byte_size %> {
@@ -482,7 +482,7 @@ type scanPlanTextAnyToInt<%= type_suffix %> struct{}
func (scanPlanTextAnyToInt<%= type_suffix %>) Scan(src []byte, dst any) error {
if src == nil {
return fmt.Errorf("cannot scan null into %T", dst)
return fmt.Errorf("cannot scan NULL into %T", dst)
}
p, ok := (dst).(*int<%= type_suffix %>)
@@ -503,7 +503,7 @@ type scanPlanTextAnyToUint<%= type_suffix %> struct{}
func (scanPlanTextAnyToUint<%= type_suffix %>) Scan(src []byte, dst any) error {
if src == nil {
return fmt.Errorf("cannot scan null into %T", dst)
return fmt.Errorf("cannot scan NULL into %T", dst)
}
p, ok := (dst).(*uint<%= type_suffix %>)
+1 -1
View File
@@ -131,7 +131,7 @@ func (scanPlanJSONToJSONUnmarshal) Scan(src []byte, dst any) error {
}
}
return fmt.Errorf("cannot scan null into %T", dst)
return fmt.Errorf("cannot scan NULL into %T", dst)
}
return json.Unmarshal(src, dst)
+2 -2
View File
@@ -86,10 +86,10 @@ func TestJSONCodecUnmarshalSQLNull(t *testing.T) {
// A string cannot scan a NULL.
str := "foobar"
err = conn.QueryRow(ctx, "select null::json").Scan(&str)
require.EqualError(t, err, "can't scan into dest[0]: cannot scan null into *string")
require.EqualError(t, err, "can't scan into dest[0]: cannot scan NULL into *string")
// A non-string cannot scan a NULL.
err = conn.QueryRow(ctx, "select null::json").Scan(&n)
require.EqualError(t, err, "can't scan into dest[0]: cannot scan null into *int")
require.EqualError(t, err, "can't scan into dest[0]: cannot scan NULL into *int")
})
}
+1 -1
View File
@@ -529,7 +529,7 @@ type scanPlanString struct{}
func (scanPlanString) Scan(src []byte, dst any) error {
if src == nil {
return fmt.Errorf("cannot scan null into %T", dst)
return fmt.Errorf("cannot scan NULL into %T", dst)
}
p := (dst).(*string)
+2 -2
View File
@@ -74,7 +74,7 @@ type scanPlanQcharCodecByte struct{}
func (scanPlanQcharCodecByte) Scan(src []byte, dst any) error {
if src == nil {
return fmt.Errorf("cannot scan null into %T", dst)
return fmt.Errorf("cannot scan NULL into %T", dst)
}
if len(src) > 1 {
@@ -96,7 +96,7 @@ type scanPlanQcharCodecRune struct{}
func (scanPlanQcharCodecRune) Scan(src []byte, dst any) error {
if src == nil {
return fmt.Errorf("cannot scan null into %T", dst)
return fmt.Errorf("cannot scan NULL into %T", dst)
}
if len(src) > 1 {
+8 -8
View File
@@ -107,7 +107,7 @@ func (plan *encodePlanRangeCodecRangeValuerToBinary) Encode(value any, buf []byt
if lowerType != Unbounded {
if lower == nil {
return nil, fmt.Errorf("Lower cannot be null unless LowerType is Unbounded")
return nil, fmt.Errorf("Lower cannot be NULL unless LowerType is Unbounded")
}
sp := len(buf)
@@ -123,7 +123,7 @@ func (plan *encodePlanRangeCodecRangeValuerToBinary) Encode(value any, buf []byt
return nil, fmt.Errorf("failed to encode %v as element of range: %v", lower, err)
}
if buf == nil {
return nil, fmt.Errorf("Lower cannot be null unless LowerType is Unbounded")
return nil, fmt.Errorf("Lower cannot be NULL unless LowerType is Unbounded")
}
pgio.SetInt32(buf[sp:], int32(len(buf[sp:])-4))
@@ -131,7 +131,7 @@ func (plan *encodePlanRangeCodecRangeValuerToBinary) Encode(value any, buf []byt
if upperType != Unbounded {
if upper == nil {
return nil, fmt.Errorf("Upper cannot be null unless UpperType is Unbounded")
return nil, fmt.Errorf("Upper cannot be NULL unless UpperType is Unbounded")
}
sp := len(buf)
@@ -147,7 +147,7 @@ func (plan *encodePlanRangeCodecRangeValuerToBinary) Encode(value any, buf []byt
return nil, fmt.Errorf("failed to encode %v as element of range: %v", upper, err)
}
if buf == nil {
return nil, fmt.Errorf("Upper cannot be null unless UpperType is Unbounded")
return nil, fmt.Errorf("Upper cannot be NULL unless UpperType is Unbounded")
}
pgio.SetInt32(buf[sp:], int32(len(buf[sp:])-4))
@@ -184,7 +184,7 @@ func (plan *encodePlanRangeCodecRangeValuerToText) Encode(value any, buf []byte)
if lowerType != Unbounded {
if lower == nil {
return nil, fmt.Errorf("Lower cannot be null unless LowerType is Unbounded")
return nil, fmt.Errorf("Lower cannot be NULL unless LowerType is Unbounded")
}
lowerPlan := plan.m.PlanEncode(plan.rc.ElementType.OID, TextFormatCode, lower)
@@ -197,7 +197,7 @@ func (plan *encodePlanRangeCodecRangeValuerToText) Encode(value any, buf []byte)
return nil, fmt.Errorf("failed to encode %v as element of range: %v", lower, err)
}
if buf == nil {
return nil, fmt.Errorf("Lower cannot be null unless LowerType is Unbounded")
return nil, fmt.Errorf("Lower cannot be NULL unless LowerType is Unbounded")
}
}
@@ -205,7 +205,7 @@ func (plan *encodePlanRangeCodecRangeValuerToText) Encode(value any, buf []byte)
if upperType != Unbounded {
if upper == nil {
return nil, fmt.Errorf("Upper cannot be null unless UpperType is Unbounded")
return nil, fmt.Errorf("Upper cannot be NULL unless UpperType is Unbounded")
}
upperPlan := plan.m.PlanEncode(plan.rc.ElementType.OID, TextFormatCode, upper)
@@ -218,7 +218,7 @@ func (plan *encodePlanRangeCodecRangeValuerToText) Encode(value any, buf []byte)
return nil, fmt.Errorf("failed to encode %v as element of range: %v", upper, err)
}
if buf == nil {
return nil, fmt.Errorf("Upper cannot be null unless UpperType is Unbounded")
return nil, fmt.Errorf("Upper cannot be NULL unless UpperType is Unbounded")
}
}
+1 -1
View File
@@ -180,7 +180,7 @@ type scanPlanTextAnyToString struct{}
func (scanPlanTextAnyToString) Scan(src []byte, dst any) error {
if src == nil {
return fmt.Errorf("cannot scan null into %T", dst)
return fmt.Errorf("cannot scan NULL into %T", dst)
}
p := (dst).(*string)
+1 -1
View File
@@ -248,7 +248,7 @@ type scanPlanBinaryUint32ToUint32 struct{}
func (scanPlanBinaryUint32ToUint32) Scan(src []byte, dst any) error {
if src == nil {
return fmt.Errorf("cannot scan null into %T", dst)
return fmt.Errorf("cannot scan NULL into %T", dst)
}
if len(src) != 4 {