From 79ba0275de20522fae625286a319e634225933e5 Mon Sep 17 00:00:00 2001 From: Damir Vandic Date: Mon, 4 Jun 2018 21:02:20 +0200 Subject: [PATCH] Add the type of the value in all decode error messages --- aclitem.go | 2 +- aclitem_array.go | 2 +- bool.go | 2 +- bool_array.go | 2 +- bpchar_array.go | 2 +- bytea.go | 2 +- bytea_array.go | 2 +- cidr_array.go | 2 +- date.go | 2 +- date_array.go | 2 +- enum_array.go | 2 +- float4_array.go | 2 +- float8_array.go | 2 +- hstore.go | 4 ++-- hstore_array.go | 2 +- inet.go | 2 +- inet_array.go | 2 +- int2_array.go | 2 +- int4_array.go | 2 +- int8_array.go | 2 +- interval.go | 2 +- macaddr.go | 2 +- numeric_array.go | 2 +- record.go | 2 +- text.go | 2 +- text_array.go | 2 +- timestamp.go | 2 +- timestamp_array.go | 2 +- timestamptz.go | 2 +- timestamptz_array.go | 2 +- typed_array.go.erb | 2 +- uuid_array.go | 2 +- varchar_array.go | 2 +- 33 files changed, 34 insertions(+), 34 deletions(-) diff --git a/aclitem.go b/aclitem.go index 35269e91..4da962dd 100644 --- a/aclitem.go +++ b/aclitem.go @@ -70,7 +70,7 @@ func (src *ACLItem) AssignTo(dst interface{}) error { return NullAssignTo(dst) } - return errors.Errorf("cannot decode %v into %T", src, dst) + return errors.Errorf("cannot decode %#v into %T", src, dst) } func (dst *ACLItem) DecodeText(ci *ConnInfo, src []byte) error { diff --git a/aclitem_array.go b/aclitem_array.go index 0a829295..d8bf3303 100644 --- a/aclitem_array.go +++ b/aclitem_array.go @@ -84,7 +84,7 @@ func (src *ACLItemArray) AssignTo(dst interface{}) error { return NullAssignTo(dst) } - return errors.Errorf("cannot decode %v into %T", src, dst) + return errors.Errorf("cannot decode %#v into %T", src, dst) } func (dst *ACLItemArray) DecodeText(ci *ConnInfo, src []byte) error { diff --git a/bool.go b/bool.go index 308ba304..0574588d 100644 --- a/bool.go +++ b/bool.go @@ -64,7 +64,7 @@ func (src *Bool) AssignTo(dst interface{}) error { return NullAssignTo(dst) } - return errors.Errorf("cannot decode %v into %T", src, dst) + return errors.Errorf("cannot decode %#v into %T", src, dst) } func (dst *Bool) DecodeText(ci *ConnInfo, src []byte) error { diff --git a/bool_array.go b/bool_array.go index 67dd92a7..4231e29d 100644 --- a/bool_array.go +++ b/bool_array.go @@ -86,7 +86,7 @@ func (src *BoolArray) AssignTo(dst interface{}) error { return NullAssignTo(dst) } - return errors.Errorf("cannot decode %v into %T", src, dst) + return errors.Errorf("cannot decode %#v into %T", src, dst) } func (dst *BoolArray) DecodeText(ci *ConnInfo, src []byte) error { diff --git a/bpchar_array.go b/bpchar_array.go index 1e6220f7..b3f36cb6 100644 --- a/bpchar_array.go +++ b/bpchar_array.go @@ -86,7 +86,7 @@ func (src *BPCharArray) AssignTo(dst interface{}) error { return NullAssignTo(dst) } - return errors.Errorf("cannot decode %v into %T", src, dst) + return errors.Errorf("cannot decode %#v into %T", src, dst) } func (dst *BPCharArray) DecodeText(ci *ConnInfo, src []byte) error { diff --git a/bytea.go b/bytea.go index c7117f48..4506dc31 100644 --- a/bytea.go +++ b/bytea.go @@ -64,7 +64,7 @@ func (src *Bytea) AssignTo(dst interface{}) error { return NullAssignTo(dst) } - return errors.Errorf("cannot decode %v into %T", src, dst) + return errors.Errorf("cannot decode %#v into %T", src, dst) } // DecodeText only supports the hex format. This has been the default since diff --git a/bytea_array.go b/bytea_array.go index c8eb5669..9c094b28 100644 --- a/bytea_array.go +++ b/bytea_array.go @@ -86,7 +86,7 @@ func (src *ByteaArray) AssignTo(dst interface{}) error { return NullAssignTo(dst) } - return errors.Errorf("cannot decode %v into %T", src, dst) + return errors.Errorf("cannot decode %#v into %T", src, dst) } func (dst *ByteaArray) DecodeText(ci *ConnInfo, src []byte) error { diff --git a/cidr_array.go b/cidr_array.go index e4bb7614..c254c834 100644 --- a/cidr_array.go +++ b/cidr_array.go @@ -115,7 +115,7 @@ func (src *CIDRArray) AssignTo(dst interface{}) error { return NullAssignTo(dst) } - return errors.Errorf("cannot decode %v into %T", src, dst) + return errors.Errorf("cannot decode %#v into %T", src, dst) } func (dst *CIDRArray) DecodeText(ci *ConnInfo, src []byte) error { diff --git a/date.go b/date.go index f1c0d8bd..b1d4c11d 100644 --- a/date.go +++ b/date.go @@ -72,7 +72,7 @@ func (src *Date) AssignTo(dst interface{}) error { return NullAssignTo(dst) } - return errors.Errorf("cannot decode %v into %T", src, dst) + return errors.Errorf("cannot decode %#v into %T", src, dst) } func (dst *Date) DecodeText(ci *ConnInfo, src []byte) error { diff --git a/date_array.go b/date_array.go index 0cb64581..c0f5c21c 100644 --- a/date_array.go +++ b/date_array.go @@ -87,7 +87,7 @@ func (src *DateArray) AssignTo(dst interface{}) error { return NullAssignTo(dst) } - return errors.Errorf("cannot decode %v into %T", src, dst) + return errors.Errorf("cannot decode %#v into %T", src, dst) } func (dst *DateArray) DecodeText(ci *ConnInfo, src []byte) error { diff --git a/enum_array.go b/enum_array.go index 3a948015..7168cb8a 100644 --- a/enum_array.go +++ b/enum_array.go @@ -84,7 +84,7 @@ func (src *EnumArray) AssignTo(dst interface{}) error { return NullAssignTo(dst) } - return errors.Errorf("cannot decode %v into %T", src, dst) + return errors.Errorf("cannot decode %#v into %T", src, dst) } func (dst *EnumArray) DecodeText(ci *ConnInfo, src []byte) error { diff --git a/float4_array.go b/float4_array.go index 02c28caa..fba181d3 100644 --- a/float4_array.go +++ b/float4_array.go @@ -86,7 +86,7 @@ func (src *Float4Array) AssignTo(dst interface{}) error { return NullAssignTo(dst) } - return errors.Errorf("cannot decode %v into %T", src, dst) + return errors.Errorf("cannot decode %#v into %T", src, dst) } func (dst *Float4Array) DecodeText(ci *ConnInfo, src []byte) error { diff --git a/float8_array.go b/float8_array.go index b92a8205..13dbf27f 100644 --- a/float8_array.go +++ b/float8_array.go @@ -86,7 +86,7 @@ func (src *Float8Array) AssignTo(dst interface{}) error { return NullAssignTo(dst) } - return errors.Errorf("cannot decode %v into %T", src, dst) + return errors.Errorf("cannot decode %#v into %T", src, dst) } func (dst *Float8Array) DecodeText(ci *ConnInfo, src []byte) error { diff --git a/hstore.go b/hstore.go index 347446ae..71b030f9 100644 --- a/hstore.go +++ b/hstore.go @@ -59,7 +59,7 @@ func (src *Hstore) AssignTo(dst interface{}) error { *v = make(map[string]string, len(src.Map)) for k, val := range src.Map { if val.Status != Present { - return errors.Errorf("cannot decode %v into %T", src, dst) + return errors.Errorf("cannot decode %#v into %T", src, dst) } (*v)[k] = val.String } @@ -73,7 +73,7 @@ func (src *Hstore) AssignTo(dst interface{}) error { return NullAssignTo(dst) } - return errors.Errorf("cannot decode %v into %T", src, dst) + return errors.Errorf("cannot decode %#v into %T", src, dst) } func (dst *Hstore) DecodeText(ci *ConnInfo, src []byte) error { diff --git a/hstore_array.go b/hstore_array.go index 80530c26..2b8cf37e 100644 --- a/hstore_array.go +++ b/hstore_array.go @@ -86,7 +86,7 @@ func (src *HstoreArray) AssignTo(dst interface{}) error { return NullAssignTo(dst) } - return errors.Errorf("cannot decode %v into %T", src, dst) + return errors.Errorf("cannot decode %#v into %T", src, dst) } func (dst *HstoreArray) DecodeText(ci *ConnInfo, src []byte) error { diff --git a/inet.go b/inet.go index 01fc0e5b..d93e6347 100644 --- a/inet.go +++ b/inet.go @@ -91,7 +91,7 @@ func (src *Inet) AssignTo(dst interface{}) error { return NullAssignTo(dst) } - return errors.Errorf("cannot decode %v into %T", src, dst) + return errors.Errorf("cannot decode %#v into %T", src, dst) } func (dst *Inet) DecodeText(ci *ConnInfo, src []byte) error { diff --git a/inet_array.go b/inet_array.go index f3e4efbf..dba369d2 100644 --- a/inet_array.go +++ b/inet_array.go @@ -115,7 +115,7 @@ func (src *InetArray) AssignTo(dst interface{}) error { return NullAssignTo(dst) } - return errors.Errorf("cannot decode %v into %T", src, dst) + return errors.Errorf("cannot decode %#v into %T", src, dst) } func (dst *InetArray) DecodeText(ci *ConnInfo, src []byte) error { diff --git a/int2_array.go b/int2_array.go index f50d9275..7fefbd95 100644 --- a/int2_array.go +++ b/int2_array.go @@ -114,7 +114,7 @@ func (src *Int2Array) AssignTo(dst interface{}) error { return NullAssignTo(dst) } - return errors.Errorf("cannot decode %v into %T", src, dst) + return errors.Errorf("cannot decode %#v into %T", src, dst) } func (dst *Int2Array) DecodeText(ci *ConnInfo, src []byte) error { diff --git a/int4_array.go b/int4_array.go index 6c9418ba..4e78ce71 100644 --- a/int4_array.go +++ b/int4_array.go @@ -114,7 +114,7 @@ func (src *Int4Array) AssignTo(dst interface{}) error { return NullAssignTo(dst) } - return errors.Errorf("cannot decode %v into %T", src, dst) + return errors.Errorf("cannot decode %#v into %T", src, dst) } func (dst *Int4Array) DecodeText(ci *ConnInfo, src []byte) error { diff --git a/int8_array.go b/int8_array.go index bb6ce004..15a8398a 100644 --- a/int8_array.go +++ b/int8_array.go @@ -114,7 +114,7 @@ func (src *Int8Array) AssignTo(dst interface{}) error { return NullAssignTo(dst) } - return errors.Errorf("cannot decode %v into %T", src, dst) + return errors.Errorf("cannot decode %#v into %T", src, dst) } func (dst *Int8Array) DecodeText(ci *ConnInfo, src []byte) error { diff --git a/interval.go b/interval.go index 799ce53a..dc696319 100644 --- a/interval.go +++ b/interval.go @@ -74,7 +74,7 @@ func (src *Interval) AssignTo(dst interface{}) error { return NullAssignTo(dst) } - return errors.Errorf("cannot decode %v into %T", src, dst) + return errors.Errorf("cannot decode %#v into %T", src, dst) } func (dst *Interval) DecodeText(ci *ConnInfo, src []byte) error { diff --git a/macaddr.go b/macaddr.go index 4c6e2212..79004be4 100644 --- a/macaddr.go +++ b/macaddr.go @@ -70,7 +70,7 @@ func (src *Macaddr) AssignTo(dst interface{}) error { return NullAssignTo(dst) } - return errors.Errorf("cannot decode %v into %T", src, dst) + return errors.Errorf("cannot decode %#v into %T", src, dst) } func (dst *Macaddr) DecodeText(ci *ConnInfo, src []byte) error { diff --git a/numeric_array.go b/numeric_array.go index 9c8f8eb3..b5e38539 100644 --- a/numeric_array.go +++ b/numeric_array.go @@ -170,7 +170,7 @@ func (src *NumericArray) AssignTo(dst interface{}) error { return NullAssignTo(dst) } - return errors.Errorf("cannot decode %v into %T", src, dst) + return errors.Errorf("cannot decode %#v into %T", src, dst) } func (dst *NumericArray) DecodeText(ci *ConnInfo, src []byte) error { diff --git a/record.go b/record.go index aeca1c54..64c6f13a 100644 --- a/record.go +++ b/record.go @@ -67,7 +67,7 @@ func (src *Record) AssignTo(dst interface{}) error { return NullAssignTo(dst) } - return errors.Errorf("cannot decode %v into %T", src, dst) + return errors.Errorf("cannot decode %#v into %T", src, dst) } func (dst *Record) DecodeBinary(ci *ConnInfo, src []byte) error { diff --git a/text.go b/text.go index bceeffd4..919743fe 100644 --- a/text.go +++ b/text.go @@ -74,7 +74,7 @@ func (src *Text) AssignTo(dst interface{}) error { return NullAssignTo(dst) } - return errors.Errorf("cannot decode %v into %T", src, dst) + return errors.Errorf("cannot decode %#v into %T", src, dst) } func (dst *Text) DecodeText(ci *ConnInfo, src []byte) error { diff --git a/text_array.go b/text_array.go index e40f4b86..d53f0b7b 100644 --- a/text_array.go +++ b/text_array.go @@ -86,7 +86,7 @@ func (src *TextArray) AssignTo(dst interface{}) error { return NullAssignTo(dst) } - return errors.Errorf("cannot decode %v into %T", src, dst) + return errors.Errorf("cannot decode %#v into %T", src, dst) } func (dst *TextArray) DecodeText(ci *ConnInfo, src []byte) error { diff --git a/timestamp.go b/timestamp.go index d906f467..6292521a 100644 --- a/timestamp.go +++ b/timestamp.go @@ -76,7 +76,7 @@ func (src *Timestamp) AssignTo(dst interface{}) error { return NullAssignTo(dst) } - return errors.Errorf("cannot decode %v into %T", src, dst) + return errors.Errorf("cannot decode %#v into %T", src, dst) } // DecodeText decodes from src into dst. The decoded time is considered to diff --git a/timestamp_array.go b/timestamp_array.go index 546a3810..11b32a11 100644 --- a/timestamp_array.go +++ b/timestamp_array.go @@ -87,7 +87,7 @@ func (src *TimestampArray) AssignTo(dst interface{}) error { return NullAssignTo(dst) } - return errors.Errorf("cannot decode %v into %T", src, dst) + return errors.Errorf("cannot decode %#v into %T", src, dst) } func (dst *TimestampArray) DecodeText(ci *ConnInfo, src []byte) error { diff --git a/timestamptz.go b/timestamptz.go index 74fe4954..2b9d2a64 100644 --- a/timestamptz.go +++ b/timestamptz.go @@ -77,7 +77,7 @@ func (src *Timestamptz) AssignTo(dst interface{}) error { return NullAssignTo(dst) } - return errors.Errorf("cannot decode %v into %T", src, dst) + return errors.Errorf("cannot decode %#v into %T", src, dst) } func (dst *Timestamptz) DecodeText(ci *ConnInfo, src []byte) error { diff --git a/timestamptz_array.go b/timestamptz_array.go index 88b6cc5f..31c11f94 100644 --- a/timestamptz_array.go +++ b/timestamptz_array.go @@ -87,7 +87,7 @@ func (src *TimestamptzArray) AssignTo(dst interface{}) error { return NullAssignTo(dst) } - return errors.Errorf("cannot decode %v into %T", src, dst) + return errors.Errorf("cannot decode %#v into %T", src, dst) } func (dst *TimestamptzArray) DecodeText(ci *ConnInfo, src []byte) error { diff --git a/typed_array.go.erb b/typed_array.go.erb index 6fafc2df..6b46a23e 100644 --- a/typed_array.go.erb +++ b/typed_array.go.erb @@ -86,7 +86,7 @@ func (src *<%= pgtype_array_type %>) AssignTo(dst interface{}) error { return NullAssignTo(dst) } - return errors.Errorf("cannot decode %v into %T", src, dst) + return errors.Errorf("cannot decode %#v into %T", src, dst) } func (dst *<%= pgtype_array_type %>) DecodeText(ci *ConnInfo, src []byte) error { diff --git a/uuid_array.go b/uuid_array.go index 9c7843a7..13efdb23 100644 --- a/uuid_array.go +++ b/uuid_array.go @@ -142,7 +142,7 @@ func (src *UUIDArray) AssignTo(dst interface{}) error { return NullAssignTo(dst) } - return errors.Errorf("cannot decode %v into %T", src, dst) + return errors.Errorf("cannot decode %#v into %T", src, dst) } func (dst *UUIDArray) DecodeText(ci *ConnInfo, src []byte) error { diff --git a/varchar_array.go b/varchar_array.go index 09eba3ea..a7f23fba 100644 --- a/varchar_array.go +++ b/varchar_array.go @@ -86,7 +86,7 @@ func (src *VarcharArray) AssignTo(dst interface{}) error { return NullAssignTo(dst) } - return errors.Errorf("cannot decode %v into %T", src, dst) + return errors.Errorf("cannot decode %#v into %T", src, dst) } func (dst *VarcharArray) DecodeText(ci *ConnInfo, src []byte) error {