From 9d7fc8e63aa911ad288a838222a1fc2b359a3426 Mon Sep 17 00:00:00 2001 From: Jack Christensen Date: Sat, 24 Oct 2020 09:21:42 -0500 Subject: [PATCH] AssignTo pointer to pointer to slice and named types fixes #69 --- aclitem_array.go | 11 +++++------ bool_array.go | 11 +++++------ bpchar_array.go | 11 +++++------ bytea_array.go | 11 +++++------ cidr_array.go | 11 +++++------ date_array.go | 11 +++++------ enum_array.go | 11 +++++------ float4_array.go | 11 +++++------ float8_array.go | 11 +++++------ hstore_array.go | 11 +++++------ inet_array.go | 11 +++++------ int2_array.go | 11 +++++------ int4_array.go | 11 +++++------ int8_array.go | 11 +++++------ jsonb_array.go | 11 +++++------ macaddr_array.go | 11 +++++------ numeric_array.go | 11 +++++------ text_array.go | 11 +++++------ timestamp_array.go | 11 +++++------ timestamptz_array.go | 11 +++++------ tstzrange_array.go | 11 +++++------ typed_array.go.erb | 11 +++++------ uuid_array.go | 11 +++++------ varchar_array.go | 11 +++++------ 24 files changed, 120 insertions(+), 144 deletions(-) diff --git a/aclitem_array.go b/aclitem_array.go index 95f74aa7..229136ec 100644 --- a/aclitem_array.go +++ b/aclitem_array.go @@ -219,6 +219,11 @@ func (src *ACLItemArray) AssignTo(dst interface{}) error { } } + // Try to convert to something AssignTo can use directly. + if nextDst, retry := GetAssignToDstType(dst); retry { + return src.AssignTo(nextDst) + } + // Fallback to reflection if an optimised match was not found. // The reflection is necessary for arrays and multidimensional slices, // but it comes with a 20-50% performance penalty for large arrays/slices @@ -226,12 +231,6 @@ func (src *ACLItemArray) AssignTo(dst interface{}) error { if value.Kind() == reflect.Ptr { value = value.Elem() } - if !value.CanSet() { - if nextDst, retry := GetAssignToDstType(dst); retry { - return src.AssignTo(nextDst) - } - return errors.Errorf("unable to assign to %T", dst) - } elementCount, err := src.assignToRecursive(value, 0, 0) if err != nil { diff --git a/bool_array.go b/bool_array.go index c9447db1..9c960b0f 100644 --- a/bool_array.go +++ b/bool_array.go @@ -221,6 +221,11 @@ func (src *BoolArray) AssignTo(dst interface{}) error { } } + // Try to convert to something AssignTo can use directly. + if nextDst, retry := GetAssignToDstType(dst); retry { + return src.AssignTo(nextDst) + } + // Fallback to reflection if an optimised match was not found. // The reflection is necessary for arrays and multidimensional slices, // but it comes with a 20-50% performance penalty for large arrays/slices @@ -228,12 +233,6 @@ func (src *BoolArray) AssignTo(dst interface{}) error { if value.Kind() == reflect.Ptr { value = value.Elem() } - if !value.CanSet() { - if nextDst, retry := GetAssignToDstType(dst); retry { - return src.AssignTo(nextDst) - } - return errors.Errorf("unable to assign to %T", dst) - } elementCount, err := src.assignToRecursive(value, 0, 0) if err != nil { diff --git a/bpchar_array.go b/bpchar_array.go index f814930f..89a14aa0 100644 --- a/bpchar_array.go +++ b/bpchar_array.go @@ -221,6 +221,11 @@ func (src *BPCharArray) AssignTo(dst interface{}) error { } } + // Try to convert to something AssignTo can use directly. + if nextDst, retry := GetAssignToDstType(dst); retry { + return src.AssignTo(nextDst) + } + // Fallback to reflection if an optimised match was not found. // The reflection is necessary for arrays and multidimensional slices, // but it comes with a 20-50% performance penalty for large arrays/slices @@ -228,12 +233,6 @@ func (src *BPCharArray) AssignTo(dst interface{}) error { if value.Kind() == reflect.Ptr { value = value.Elem() } - if !value.CanSet() { - if nextDst, retry := GetAssignToDstType(dst); retry { - return src.AssignTo(nextDst) - } - return errors.Errorf("unable to assign to %T", dst) - } elementCount, err := src.assignToRecursive(value, 0, 0) if err != nil { diff --git a/bytea_array.go b/bytea_array.go index 618a2f4b..425ef954 100644 --- a/bytea_array.go +++ b/bytea_array.go @@ -193,6 +193,11 @@ func (src *ByteaArray) AssignTo(dst interface{}) error { } } + // Try to convert to something AssignTo can use directly. + if nextDst, retry := GetAssignToDstType(dst); retry { + return src.AssignTo(nextDst) + } + // Fallback to reflection if an optimised match was not found. // The reflection is necessary for arrays and multidimensional slices, // but it comes with a 20-50% performance penalty for large arrays/slices @@ -200,12 +205,6 @@ func (src *ByteaArray) AssignTo(dst interface{}) error { if value.Kind() == reflect.Ptr { value = value.Elem() } - if !value.CanSet() { - if nextDst, retry := GetAssignToDstType(dst); retry { - return src.AssignTo(nextDst) - } - return errors.Errorf("unable to assign to %T", dst) - } elementCount, err := src.assignToRecursive(value, 0, 0) if err != nil { diff --git a/cidr_array.go b/cidr_array.go index 8ea7d7a6..4ad10d8b 100644 --- a/cidr_array.go +++ b/cidr_array.go @@ -250,6 +250,11 @@ func (src *CIDRArray) AssignTo(dst interface{}) error { } } + // Try to convert to something AssignTo can use directly. + if nextDst, retry := GetAssignToDstType(dst); retry { + return src.AssignTo(nextDst) + } + // Fallback to reflection if an optimised match was not found. // The reflection is necessary for arrays and multidimensional slices, // but it comes with a 20-50% performance penalty for large arrays/slices @@ -257,12 +262,6 @@ func (src *CIDRArray) AssignTo(dst interface{}) error { if value.Kind() == reflect.Ptr { value = value.Elem() } - if !value.CanSet() { - if nextDst, retry := GetAssignToDstType(dst); retry { - return src.AssignTo(nextDst) - } - return errors.Errorf("unable to assign to %T", dst) - } elementCount, err := src.assignToRecursive(value, 0, 0) if err != nil { diff --git a/date_array.go b/date_array.go index dc4cb2e3..b29eee67 100644 --- a/date_array.go +++ b/date_array.go @@ -222,6 +222,11 @@ func (src *DateArray) AssignTo(dst interface{}) error { } } + // Try to convert to something AssignTo can use directly. + if nextDst, retry := GetAssignToDstType(dst); retry { + return src.AssignTo(nextDst) + } + // Fallback to reflection if an optimised match was not found. // The reflection is necessary for arrays and multidimensional slices, // but it comes with a 20-50% performance penalty for large arrays/slices @@ -229,12 +234,6 @@ func (src *DateArray) AssignTo(dst interface{}) error { if value.Kind() == reflect.Ptr { value = value.Elem() } - if !value.CanSet() { - if nextDst, retry := GetAssignToDstType(dst); retry { - return src.AssignTo(nextDst) - } - return errors.Errorf("unable to assign to %T", dst) - } elementCount, err := src.assignToRecursive(value, 0, 0) if err != nil { diff --git a/enum_array.go b/enum_array.go index f5312a04..76caac95 100644 --- a/enum_array.go +++ b/enum_array.go @@ -219,6 +219,11 @@ func (src *EnumArray) AssignTo(dst interface{}) error { } } + // Try to convert to something AssignTo can use directly. + if nextDst, retry := GetAssignToDstType(dst); retry { + return src.AssignTo(nextDst) + } + // Fallback to reflection if an optimised match was not found. // The reflection is necessary for arrays and multidimensional slices, // but it comes with a 20-50% performance penalty for large arrays/slices @@ -226,12 +231,6 @@ func (src *EnumArray) AssignTo(dst interface{}) error { if value.Kind() == reflect.Ptr { value = value.Elem() } - if !value.CanSet() { - if nextDst, retry := GetAssignToDstType(dst); retry { - return src.AssignTo(nextDst) - } - return errors.Errorf("unable to assign to %T", dst) - } elementCount, err := src.assignToRecursive(value, 0, 0) if err != nil { diff --git a/float4_array.go b/float4_array.go index 88dd84ab..d314563c 100644 --- a/float4_array.go +++ b/float4_array.go @@ -221,6 +221,11 @@ func (src *Float4Array) AssignTo(dst interface{}) error { } } + // Try to convert to something AssignTo can use directly. + if nextDst, retry := GetAssignToDstType(dst); retry { + return src.AssignTo(nextDst) + } + // Fallback to reflection if an optimised match was not found. // The reflection is necessary for arrays and multidimensional slices, // but it comes with a 20-50% performance penalty for large arrays/slices @@ -228,12 +233,6 @@ func (src *Float4Array) AssignTo(dst interface{}) error { if value.Kind() == reflect.Ptr { value = value.Elem() } - if !value.CanSet() { - if nextDst, retry := GetAssignToDstType(dst); retry { - return src.AssignTo(nextDst) - } - return errors.Errorf("unable to assign to %T", dst) - } elementCount, err := src.assignToRecursive(value, 0, 0) if err != nil { diff --git a/float8_array.go b/float8_array.go index 9d79a449..60d1a6d2 100644 --- a/float8_array.go +++ b/float8_array.go @@ -221,6 +221,11 @@ func (src *Float8Array) AssignTo(dst interface{}) error { } } + // Try to convert to something AssignTo can use directly. + if nextDst, retry := GetAssignToDstType(dst); retry { + return src.AssignTo(nextDst) + } + // Fallback to reflection if an optimised match was not found. // The reflection is necessary for arrays and multidimensional slices, // but it comes with a 20-50% performance penalty for large arrays/slices @@ -228,12 +233,6 @@ func (src *Float8Array) AssignTo(dst interface{}) error { if value.Kind() == reflect.Ptr { value = value.Elem() } - if !value.CanSet() { - if nextDst, retry := GetAssignToDstType(dst); retry { - return src.AssignTo(nextDst) - } - return errors.Errorf("unable to assign to %T", dst) - } elementCount, err := src.assignToRecursive(value, 0, 0) if err != nil { diff --git a/hstore_array.go b/hstore_array.go index d0b34b3c..02abe870 100644 --- a/hstore_array.go +++ b/hstore_array.go @@ -193,6 +193,11 @@ func (src *HstoreArray) AssignTo(dst interface{}) error { } } + // Try to convert to something AssignTo can use directly. + if nextDst, retry := GetAssignToDstType(dst); retry { + return src.AssignTo(nextDst) + } + // Fallback to reflection if an optimised match was not found. // The reflection is necessary for arrays and multidimensional slices, // but it comes with a 20-50% performance penalty for large arrays/slices @@ -200,12 +205,6 @@ func (src *HstoreArray) AssignTo(dst interface{}) error { if value.Kind() == reflect.Ptr { value = value.Elem() } - if !value.CanSet() { - if nextDst, retry := GetAssignToDstType(dst); retry { - return src.AssignTo(nextDst) - } - return errors.Errorf("unable to assign to %T", dst) - } elementCount, err := src.assignToRecursive(value, 0, 0) if err != nil { diff --git a/inet_array.go b/inet_array.go index 2058db81..4f8211ab 100644 --- a/inet_array.go +++ b/inet_array.go @@ -250,6 +250,11 @@ func (src *InetArray) AssignTo(dst interface{}) error { } } + // Try to convert to something AssignTo can use directly. + if nextDst, retry := GetAssignToDstType(dst); retry { + return src.AssignTo(nextDst) + } + // Fallback to reflection if an optimised match was not found. // The reflection is necessary for arrays and multidimensional slices, // but it comes with a 20-50% performance penalty for large arrays/slices @@ -257,12 +262,6 @@ func (src *InetArray) AssignTo(dst interface{}) error { if value.Kind() == reflect.Ptr { value = value.Elem() } - if !value.CanSet() { - if nextDst, retry := GetAssignToDstType(dst); retry { - return src.AssignTo(nextDst) - } - return errors.Errorf("unable to assign to %T", dst) - } elementCount, err := src.assignToRecursive(value, 0, 0) if err != nil { diff --git a/int2_array.go b/int2_array.go index bf6a6284..180db652 100644 --- a/int2_array.go +++ b/int2_array.go @@ -613,6 +613,11 @@ func (src *Int2Array) AssignTo(dst interface{}) error { } } + // Try to convert to something AssignTo can use directly. + if nextDst, retry := GetAssignToDstType(dst); retry { + return src.AssignTo(nextDst) + } + // Fallback to reflection if an optimised match was not found. // The reflection is necessary for arrays and multidimensional slices, // but it comes with a 20-50% performance penalty for large arrays/slices @@ -620,12 +625,6 @@ func (src *Int2Array) AssignTo(dst interface{}) error { if value.Kind() == reflect.Ptr { value = value.Elem() } - if !value.CanSet() { - if nextDst, retry := GetAssignToDstType(dst); retry { - return src.AssignTo(nextDst) - } - return errors.Errorf("unable to assign to %T", dst) - } elementCount, err := src.assignToRecursive(value, 0, 0) if err != nil { diff --git a/int4_array.go b/int4_array.go index 05e10dc3..d36071a0 100644 --- a/int4_array.go +++ b/int4_array.go @@ -613,6 +613,11 @@ func (src *Int4Array) AssignTo(dst interface{}) error { } } + // Try to convert to something AssignTo can use directly. + if nextDst, retry := GetAssignToDstType(dst); retry { + return src.AssignTo(nextDst) + } + // Fallback to reflection if an optimised match was not found. // The reflection is necessary for arrays and multidimensional slices, // but it comes with a 20-50% performance penalty for large arrays/slices @@ -620,12 +625,6 @@ func (src *Int4Array) AssignTo(dst interface{}) error { if value.Kind() == reflect.Ptr { value = value.Elem() } - if !value.CanSet() { - if nextDst, retry := GetAssignToDstType(dst); retry { - return src.AssignTo(nextDst) - } - return errors.Errorf("unable to assign to %T", dst) - } elementCount, err := src.assignToRecursive(value, 0, 0) if err != nil { diff --git a/int8_array.go b/int8_array.go index d149558f..3adb2f02 100644 --- a/int8_array.go +++ b/int8_array.go @@ -613,6 +613,11 @@ func (src *Int8Array) AssignTo(dst interface{}) error { } } + // Try to convert to something AssignTo can use directly. + if nextDst, retry := GetAssignToDstType(dst); retry { + return src.AssignTo(nextDst) + } + // Fallback to reflection if an optimised match was not found. // The reflection is necessary for arrays and multidimensional slices, // but it comes with a 20-50% performance penalty for large arrays/slices @@ -620,12 +625,6 @@ func (src *Int8Array) AssignTo(dst interface{}) error { if value.Kind() == reflect.Ptr { value = value.Elem() } - if !value.CanSet() { - if nextDst, retry := GetAssignToDstType(dst); retry { - return src.AssignTo(nextDst) - } - return errors.Errorf("unable to assign to %T", dst) - } elementCount, err := src.assignToRecursive(value, 0, 0) if err != nil { diff --git a/jsonb_array.go b/jsonb_array.go index 36411b9d..562b0654 100644 --- a/jsonb_array.go +++ b/jsonb_array.go @@ -221,6 +221,11 @@ func (src *JSONBArray) AssignTo(dst interface{}) error { } } + // Try to convert to something AssignTo can use directly. + if nextDst, retry := GetAssignToDstType(dst); retry { + return src.AssignTo(nextDst) + } + // Fallback to reflection if an optimised match was not found. // The reflection is necessary for arrays and multidimensional slices, // but it comes with a 20-50% performance penalty for large arrays/slices @@ -228,12 +233,6 @@ func (src *JSONBArray) AssignTo(dst interface{}) error { if value.Kind() == reflect.Ptr { value = value.Elem() } - if !value.CanSet() { - if nextDst, retry := GetAssignToDstType(dst); retry { - return src.AssignTo(nextDst) - } - return errors.Errorf("unable to assign to %T", dst) - } elementCount, err := src.assignToRecursive(value, 0, 0) if err != nil { diff --git a/macaddr_array.go b/macaddr_array.go index 2ec5971e..511cd9ca 100644 --- a/macaddr_array.go +++ b/macaddr_array.go @@ -222,6 +222,11 @@ func (src *MacaddrArray) AssignTo(dst interface{}) error { } } + // Try to convert to something AssignTo can use directly. + if nextDst, retry := GetAssignToDstType(dst); retry { + return src.AssignTo(nextDst) + } + // Fallback to reflection if an optimised match was not found. // The reflection is necessary for arrays and multidimensional slices, // but it comes with a 20-50% performance penalty for large arrays/slices @@ -229,12 +234,6 @@ func (src *MacaddrArray) AssignTo(dst interface{}) error { if value.Kind() == reflect.Ptr { value = value.Elem() } - if !value.CanSet() { - if nextDst, retry := GetAssignToDstType(dst); retry { - return src.AssignTo(nextDst) - } - return errors.Errorf("unable to assign to %T", dst) - } elementCount, err := src.assignToRecursive(value, 0, 0) if err != nil { diff --git a/numeric_array.go b/numeric_array.go index 7c044c8c..e3c18600 100644 --- a/numeric_array.go +++ b/numeric_array.go @@ -389,6 +389,11 @@ func (src *NumericArray) AssignTo(dst interface{}) error { } } + // Try to convert to something AssignTo can use directly. + if nextDst, retry := GetAssignToDstType(dst); retry { + return src.AssignTo(nextDst) + } + // Fallback to reflection if an optimised match was not found. // The reflection is necessary for arrays and multidimensional slices, // but it comes with a 20-50% performance penalty for large arrays/slices @@ -396,12 +401,6 @@ func (src *NumericArray) AssignTo(dst interface{}) error { if value.Kind() == reflect.Ptr { value = value.Elem() } - if !value.CanSet() { - if nextDst, retry := GetAssignToDstType(dst); retry { - return src.AssignTo(nextDst) - } - return errors.Errorf("unable to assign to %T", dst) - } elementCount, err := src.assignToRecursive(value, 0, 0) if err != nil { diff --git a/text_array.go b/text_array.go index 01b5e6e6..5d0215c2 100644 --- a/text_array.go +++ b/text_array.go @@ -221,6 +221,11 @@ func (src *TextArray) AssignTo(dst interface{}) error { } } + // Try to convert to something AssignTo can use directly. + if nextDst, retry := GetAssignToDstType(dst); retry { + return src.AssignTo(nextDst) + } + // Fallback to reflection if an optimised match was not found. // The reflection is necessary for arrays and multidimensional slices, // but it comes with a 20-50% performance penalty for large arrays/slices @@ -228,12 +233,6 @@ func (src *TextArray) AssignTo(dst interface{}) error { if value.Kind() == reflect.Ptr { value = value.Elem() } - if !value.CanSet() { - if nextDst, retry := GetAssignToDstType(dst); retry { - return src.AssignTo(nextDst) - } - return errors.Errorf("unable to assign to %T", dst) - } elementCount, err := src.assignToRecursive(value, 0, 0) if err != nil { diff --git a/timestamp_array.go b/timestamp_array.go index ee6037b0..2495f2c9 100644 --- a/timestamp_array.go +++ b/timestamp_array.go @@ -222,6 +222,11 @@ func (src *TimestampArray) AssignTo(dst interface{}) error { } } + // Try to convert to something AssignTo can use directly. + if nextDst, retry := GetAssignToDstType(dst); retry { + return src.AssignTo(nextDst) + } + // Fallback to reflection if an optimised match was not found. // The reflection is necessary for arrays and multidimensional slices, // but it comes with a 20-50% performance penalty for large arrays/slices @@ -229,12 +234,6 @@ func (src *TimestampArray) AssignTo(dst interface{}) error { if value.Kind() == reflect.Ptr { value = value.Elem() } - if !value.CanSet() { - if nextDst, retry := GetAssignToDstType(dst); retry { - return src.AssignTo(nextDst) - } - return errors.Errorf("unable to assign to %T", dst) - } elementCount, err := src.assignToRecursive(value, 0, 0) if err != nil { diff --git a/timestamptz_array.go b/timestamptz_array.go index 327b3ebc..7ebcf9da 100644 --- a/timestamptz_array.go +++ b/timestamptz_array.go @@ -222,6 +222,11 @@ func (src *TimestamptzArray) AssignTo(dst interface{}) error { } } + // Try to convert to something AssignTo can use directly. + if nextDst, retry := GetAssignToDstType(dst); retry { + return src.AssignTo(nextDst) + } + // Fallback to reflection if an optimised match was not found. // The reflection is necessary for arrays and multidimensional slices, // but it comes with a 20-50% performance penalty for large arrays/slices @@ -229,12 +234,6 @@ func (src *TimestamptzArray) AssignTo(dst interface{}) error { if value.Kind() == reflect.Ptr { value = value.Elem() } - if !value.CanSet() { - if nextDst, retry := GetAssignToDstType(dst); retry { - return src.AssignTo(nextDst) - } - return errors.Errorf("unable to assign to %T", dst) - } elementCount, err := src.assignToRecursive(value, 0, 0) if err != nil { diff --git a/tstzrange_array.go b/tstzrange_array.go index cac377af..dae022d0 100644 --- a/tstzrange_array.go +++ b/tstzrange_array.go @@ -174,6 +174,11 @@ func (src *TstzrangeArray) AssignTo(dst interface{}) error { } } + // Try to convert to something AssignTo can use directly. + if nextDst, retry := GetAssignToDstType(dst); retry { + return src.AssignTo(nextDst) + } + // Fallback to reflection if an optimised match was not found. // The reflection is necessary for arrays and multidimensional slices, // but it comes with a 20-50% performance penalty for large arrays/slices @@ -181,12 +186,6 @@ func (src *TstzrangeArray) AssignTo(dst interface{}) error { if value.Kind() == reflect.Ptr { value = value.Elem() } - if !value.CanSet() { - if nextDst, retry := GetAssignToDstType(dst); retry { - return src.AssignTo(nextDst) - } - return errors.Errorf("unable to assign to %T", dst) - } elementCount, err := src.assignToRecursive(value, 0, 0) if err != nil { diff --git a/typed_array.go.erb b/typed_array.go.erb index 6d34b0e1..9951bfcb 100644 --- a/typed_array.go.erb +++ b/typed_array.go.erb @@ -194,6 +194,11 @@ func (src *<%= pgtype_array_type %>) AssignTo(dst interface{}) error { } } + // Try to convert to something AssignTo can use directly. + if nextDst, retry := GetAssignToDstType(dst); retry { + return src.AssignTo(nextDst) + } + // Fallback to reflection if an optimised match was not found. // The reflection is necessary for arrays and multidimensional slices, // but it comes with a 20-50% performance penalty for large arrays/slices @@ -201,12 +206,6 @@ func (src *<%= pgtype_array_type %>) AssignTo(dst interface{}) error { if value.Kind() == reflect.Ptr { value = value.Elem() } - if !value.CanSet() { - if nextDst, retry := GetAssignToDstType(dst); retry { - return src.AssignTo(nextDst) - } - return errors.Errorf("unable to assign to %T", dst) - } elementCount, err := src.assignToRecursive(value, 0, 0) if err != nil { diff --git a/uuid_array.go b/uuid_array.go index 33f2e62c..89cadd91 100644 --- a/uuid_array.go +++ b/uuid_array.go @@ -277,6 +277,11 @@ func (src *UUIDArray) AssignTo(dst interface{}) error { } } + // Try to convert to something AssignTo can use directly. + if nextDst, retry := GetAssignToDstType(dst); retry { + return src.AssignTo(nextDst) + } + // Fallback to reflection if an optimised match was not found. // The reflection is necessary for arrays and multidimensional slices, // but it comes with a 20-50% performance penalty for large arrays/slices @@ -284,12 +289,6 @@ func (src *UUIDArray) AssignTo(dst interface{}) error { if value.Kind() == reflect.Ptr { value = value.Elem() } - if !value.CanSet() { - if nextDst, retry := GetAssignToDstType(dst); retry { - return src.AssignTo(nextDst) - } - return errors.Errorf("unable to assign to %T", dst) - } elementCount, err := src.assignToRecursive(value, 0, 0) if err != nil { diff --git a/varchar_array.go b/varchar_array.go index b3b030b8..fd8de8a4 100644 --- a/varchar_array.go +++ b/varchar_array.go @@ -221,6 +221,11 @@ func (src *VarcharArray) AssignTo(dst interface{}) error { } } + // Try to convert to something AssignTo can use directly. + if nextDst, retry := GetAssignToDstType(dst); retry { + return src.AssignTo(nextDst) + } + // Fallback to reflection if an optimised match was not found. // The reflection is necessary for arrays and multidimensional slices, // but it comes with a 20-50% performance penalty for large arrays/slices @@ -228,12 +233,6 @@ func (src *VarcharArray) AssignTo(dst interface{}) error { if value.Kind() == reflect.Ptr { value = value.Elem() } - if !value.CanSet() { - if nextDst, retry := GetAssignToDstType(dst); retry { - return src.AssignTo(nextDst) - } - return errors.Errorf("unable to assign to %T", dst) - } elementCount, err := src.assignToRecursive(value, 0, 0) if err != nil {