From 071fc962063fd273ad16bf9ab5359f2db2c1f627 Mon Sep 17 00:00:00 2001 From: Steve Yegge Date: Mon, 24 Nov 2025 22:21:55 -0800 Subject: [PATCH] fix: resolve golangci-lint errors MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add error check for fmt.Fprintf in tips.go (errcheck) - Add nolint for safe SQL formatting in transaction.go (gosec G201) - Fix 'cancelled' -> 'canceled' spelling (misspell) šŸ¤– Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- cmd/bd/tips.go | 2 +- internal/storage/sqlite/transaction.go | 3 ++- internal/storage/sqlite/util.go | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/cmd/bd/tips.go b/cmd/bd/tips.go index 179d5a35..d679c76f 100644 --- a/cmd/bd/tips.go +++ b/cmd/bd/tips.go @@ -73,7 +73,7 @@ func maybeShowTip(store storage.Storage) { } // Display tip to stdout (informational, not an error) - fmt.Fprintf(os.Stdout, "\nšŸ’” Tip: %s\n", tip.Message) + _, _ = fmt.Fprintf(os.Stdout, "\nšŸ’” Tip: %s\n", tip.Message) // Record that we showed this tip recordTipShown(store, tip.ID) diff --git a/internal/storage/sqlite/transaction.go b/internal/storage/sqlite/transaction.go index f8fefe8e..f108f454 100644 --- a/internal/storage/sqlite/transaction.go +++ b/internal/storage/sqlite/transaction.go @@ -57,7 +57,7 @@ func (s *SQLiteStorage) RunInTransaction(ctx context.Context, fn func(tx storage committed := false defer func() { if !committed { - // Use background context to ensure rollback completes even if ctx is cancelled + // Use background context to ensure rollback completes even if ctx is canceled _, _ = conn.ExecContext(context.Background(), "ROLLBACK") } }() @@ -1123,6 +1123,7 @@ func (t *sqliteTxStorage) getLabelsForIssues(ctx context.Context, issueIDs []str args[i] = id } + // nolint:gosec // G201: placeholders is only "?" characters, not user input query := fmt.Sprintf(` SELECT issue_id, label FROM labels WHERE issue_id IN (%s) diff --git a/internal/storage/sqlite/util.go b/internal/storage/sqlite/util.go index bd19d1b2..9a59c62e 100644 --- a/internal/storage/sqlite/util.go +++ b/internal/storage/sqlite/util.go @@ -84,7 +84,7 @@ func IsBusyError(err error) bool { // - initialDelay: initial backoff delay (default: 10ms) // // Returns error if: -// - Context is cancelled +// - Context is canceled // - BEGIN IMMEDIATE fails with non-busy error // - All retries exhausted with SQLITE_BUSY func beginImmediateWithRetry(ctx context.Context, conn *sql.Conn, maxRetries int, initialDelay time.Duration) error {