remove unused func and parameter

pull/2202/head
martinpasaribu 2024-12-22 23:48:08 +07:00
parent e5d321f920
commit dc3aea06b5
No known key found for this signature in database
GPG Key ID: 7B00EF6AF0A3948F
2 changed files with 3 additions and 12 deletions

10
conn.go
View File

@ -420,7 +420,7 @@ func (c *Conn) IsClosed() bool {
return c.pgConn.IsClosed() return c.pgConn.IsClosed()
} }
func (c *Conn) die(err error) { func (c *Conn) die() {
if c.IsClosed() { if c.IsClosed() {
return return
} }
@ -588,14 +588,6 @@ func (c *Conn) execPrepared(ctx context.Context, sd *pgconn.StatementDescription
return result.CommandTag, result.Err return result.CommandTag, result.Err
} }
type unknownArgumentTypeQueryExecModeExecError struct {
arg any
}
func (e *unknownArgumentTypeQueryExecModeExecError) Error() string {
return fmt.Sprintf("cannot use unregistered type %T as query argument in QueryExecModeExec", e.arg)
}
func (c *Conn) execSQLParams(ctx context.Context, sql string, args []any) (pgconn.CommandTag, error) { func (c *Conn) execSQLParams(ctx context.Context, sql string, args []any) (pgconn.CommandTag, error) {
err := c.eqb.Build(c.typeMap, nil, args) err := c.eqb.Build(c.typeMap, nil, args)
if err != nil { if err != nil {

5
tx.go
View File

@ -3,7 +3,6 @@ package pgx
import ( import (
"context" "context"
"errors" "errors"
"fmt"
"strconv" "strconv"
"strings" "strings"
@ -103,7 +102,7 @@ func (c *Conn) BeginTx(ctx context.Context, txOptions TxOptions) (Tx, error) {
if err != nil { if err != nil {
// begin should never fail unless there is an underlying connection issue or // begin should never fail unless there is an underlying connection issue or
// a context timeout. In either case, the connection is possibly broken. // a context timeout. In either case, the connection is possibly broken.
c.die(errors.New("failed to begin transaction")) c.die()
return nil, err return nil, err
} }
@ -216,7 +215,7 @@ func (tx *dbTx) Rollback(ctx context.Context) error {
tx.closed = true tx.closed = true
if err != nil { if err != nil {
// A rollback failure leaves the connection in an undefined state // A rollback failure leaves the connection in an undefined state
tx.conn.die(fmt.Errorf("rollback failed: %w", err)) tx.conn.die()
return err return err
} }