From 10c3bd4e4ee5bf3fabfa2be13f5da0c268c860f0 Mon Sep 17 00:00:00 2001 From: Vlad Date: Sun, 17 Nov 2024 17:36:05 +0300 Subject: [PATCH] chore(internal/query/conn): linted --- internal/query/conn/conn.go | 7 ++----- internal/query/conn/driver.impls.go | 6 +++--- internal/query/conn/rows.go | 1 - internal/query/conn/tx.go | 1 - 4 files changed, 5 insertions(+), 10 deletions(-) diff --git a/internal/query/conn/conn.go b/internal/query/conn/conn.go index ca5d38fa1..b6bce8451 100644 --- a/internal/query/conn/conn.go +++ b/internal/query/conn/conn.go @@ -27,9 +27,7 @@ type resultNoRows struct{} func (resultNoRows) LastInsertId() (int64, error) { return 0, ErrUnsupported } func (resultNoRows) RowsAffected() (int64, error) { return 0, ErrUnsupported } -var ( - _ driver.Result = resultNoRows{} -) +var _ driver.Result = resultNoRows{} type Parent interface { Query() *query.Client @@ -141,7 +139,6 @@ func (c *Conn) execContext( }() normalizedQuery, params, err := c.normalize(query, args...) - if err != nil { return nil, xerrors.WithStackTrace(err) } @@ -169,7 +166,7 @@ func (c *Conn) queryContext(ctx context.Context, query string, args []driver.Nam return c.currentTx.QueryContext(ctx, query, args) } - var onDone = trace.DatabaseSQLOnConnQuery(c.parent.Trace(), &ctx, + onDone := trace.DatabaseSQLOnConnQuery(c.parent.Trace(), &ctx, stack.FunctionID("github.com/ydb-platform/ydb-go-sdk/v3/internal/query/conn.(*Conn).queryContext"), query, tableConn.UnknownQueryMode.String(), xcontext.IsIdempotent(ctx), c.parent.Clock().Since(c.LastUsage()), ) diff --git a/internal/query/conn/driver.impls.go b/internal/query/conn/driver.impls.go index dab962920..2d9998007 100644 --- a/internal/query/conn/driver.impls.go +++ b/internal/query/conn/driver.impls.go @@ -113,7 +113,7 @@ func (c *Conn) QueryContext(ctx context.Context, query string, args []driver.Nam } func (c *Conn) Prepare(query string) (driver.Stmt, error) { - //TODO implement me + // TODO implement me panic("implement me") } @@ -150,11 +150,11 @@ func (c *Conn) Close() (finalErr error) { } func (c *Conn) Begin() (driver.Tx, error) { - //TODO implement me + // TODO implement me panic("implement me") } func (c *Conn) LastUsage() time.Time { - //TODO implement me + // TODO implement me panic("implement me") } diff --git a/internal/query/conn/rows.go b/internal/query/conn/rows.go index 06d040273..2195fca83 100644 --- a/internal/query/conn/rows.go +++ b/internal/query/conn/rows.go @@ -89,7 +89,6 @@ func (r *rows) Next(dst []driver.Value) error { ctx := context.Background() nextRow, err := r.nextSet.NextRow(ctx) - if err != nil { if errors.Is(err, io.EOF) { return err diff --git a/internal/query/conn/tx.go b/internal/query/conn/tx.go index f598d5876..4a16f261c 100644 --- a/internal/query/conn/tx.go +++ b/internal/query/conn/tx.go @@ -164,7 +164,6 @@ func (tx *transaction) ExecContext(ctx context.Context, query string, args []dri err = tx.tx.Exec(ctx, query, options.WithParameters(¶meters), ) - if err != nil { return nil, badconn.Map(xerrors.WithStackTrace(err)) }