Skip to content

Commit 473a241

Browse files
authored
Merge pull request #2202 from martinyonatann/chore/remove-unused-parameter
remove unused func and parameter
2 parents e5d321f + dc3aea0 commit 473a241

File tree

2 files changed

+3
-12
lines changed

2 files changed

+3
-12
lines changed

conn.go

+1-9
Original file line numberDiff line numberDiff line change
@@ -420,7 +420,7 @@ func (c *Conn) IsClosed() bool {
420420
return c.pgConn.IsClosed()
421421
}
422422

423-
func (c *Conn) die(err error) {
423+
func (c *Conn) die() {
424424
if c.IsClosed() {
425425
return
426426
}
@@ -588,14 +588,6 @@ func (c *Conn) execPrepared(ctx context.Context, sd *pgconn.StatementDescription
588588
return result.CommandTag, result.Err
589589
}
590590

591-
type unknownArgumentTypeQueryExecModeExecError struct {
592-
arg any
593-
}
594-
595-
func (e *unknownArgumentTypeQueryExecModeExecError) Error() string {
596-
return fmt.Sprintf("cannot use unregistered type %T as query argument in QueryExecModeExec", e.arg)
597-
}
598-
599591
func (c *Conn) execSQLParams(ctx context.Context, sql string, args []any) (pgconn.CommandTag, error) {
600592
err := c.eqb.Build(c.typeMap, nil, args)
601593
if err != nil {

tx.go

+2-3
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ package pgx
33
import (
44
"context"
55
"errors"
6-
"fmt"
76
"strconv"
87
"strings"
98

@@ -103,7 +102,7 @@ func (c *Conn) BeginTx(ctx context.Context, txOptions TxOptions) (Tx, error) {
103102
if err != nil {
104103
// begin should never fail unless there is an underlying connection issue or
105104
// a context timeout. In either case, the connection is possibly broken.
106-
c.die(errors.New("failed to begin transaction"))
105+
c.die()
107106
return nil, err
108107
}
109108

@@ -216,7 +215,7 @@ func (tx *dbTx) Rollback(ctx context.Context) error {
216215
tx.closed = true
217216
if err != nil {
218217
// A rollback failure leaves the connection in an undefined state
219-
tx.conn.die(fmt.Errorf("rollback failed: %w", err))
218+
tx.conn.die()
220219
return err
221220
}
222221

0 commit comments

Comments
 (0)