From 0830aae884b5ab31c18531a1e31475a2e2a3cec1 Mon Sep 17 00:00:00 2001 From: Jack Christensen Date: Mon, 20 May 2019 21:03:39 -0500 Subject: [PATCH] Remove unnecessary internal function --- stdlib/sql.go | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/stdlib/sql.go b/stdlib/sql.go index 1bde8c4e..cc09a3b3 100644 --- a/stdlib/sql.go +++ b/stdlib/sql.go @@ -240,18 +240,10 @@ func (c *Conn) QueryContext(ctx context.Context, query string, argsV []driver.Na return nil, driver.ErrBadConn } - return c.queryPreparedContext(ctx, query, argsV) -} - -func (c *Conn) queryPreparedContext(ctx context.Context, name string, argsV []driver.NamedValue) (driver.Rows, error) { - if !c.conn.IsAlive() { - return nil, driver.ErrBadConn - } - args := []interface{}{databaseSQLResultFormats} args = append(args, namedValueToInterface(argsV)...) - rows, err := c.conn.Query(ctx, name, args...) + rows, err := c.conn.Query(ctx, query, args...) if err != nil { if errors.Is(err, pgconn.ErrNoBytesSent) { return nil, driver.ErrBadConn @@ -298,7 +290,7 @@ func (s *Stmt) Query(argsV []driver.Value) (driver.Rows, error) { } func (s *Stmt) QueryContext(ctx context.Context, argsV []driver.NamedValue) (driver.Rows, error) { - return s.conn.queryPreparedContext(ctx, s.ps.Name, argsV) + return s.conn.QueryContext(ctx, s.ps.Name, argsV) } type Rows struct {