diff --git a/conn.go b/conn.go index a9cb3163f..311721459 100644 --- a/conn.go +++ b/conn.go @@ -10,7 +10,6 @@ import ( "strings" "time" - "github.com/jackc/pgx/v5/internal/anynil" "github.com/jackc/pgx/v5/internal/sanitize" "github.com/jackc/pgx/v5/internal/stmtcache" "github.com/jackc/pgx/v5/pgconn" @@ -755,7 +754,6 @@ optionLoop: } c.eqb.reset() - anynil.NormalizeSlice(args) rows := c.getRows(ctx, sql, args) var err error diff --git a/extended_query_builder.go b/extended_query_builder.go index 152a24446..0cf3d28c8 100644 --- a/extended_query_builder.go +++ b/extended_query_builder.go @@ -22,8 +22,6 @@ type ExtendedQueryBuilder struct { func (eqb *ExtendedQueryBuilder) Build(m *pgtype.Map, sd *pgconn.StatementDescription, args []any) error { eqb.reset() - anynil.NormalizeSlice(args) - if sd == nil { for i := range args { err := eqb.appendParam(m, 0, pgtype.TextFormatCode, args[i]) diff --git a/internal/anynil/anynil.go b/internal/anynil/anynil.go index 5d5065ea4..061680e08 100644 --- a/internal/anynil/anynil.go +++ b/internal/anynil/anynil.go @@ -44,13 +44,3 @@ func Is(value any) bool { return false } } - -// NormalizeSlice converts all typed nils (e.g. []byte(nil)) in s into untyped nils. Other values are unmodified. s is -// mutated in place. -func NormalizeSlice(s []any) { - for i := range s { - if Is(s[i]) { - s[i] = nil - } - } -}