fix: resolve golangci-lint errors
- 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 <noreply@anthropic.com>
This commit is contained in:
@@ -73,7 +73,7 @@ func maybeShowTip(store storage.Storage) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Display tip to stdout (informational, not an error)
|
// 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
|
// Record that we showed this tip
|
||||||
recordTipShown(store, tip.ID)
|
recordTipShown(store, tip.ID)
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ func (s *SQLiteStorage) RunInTransaction(ctx context.Context, fn func(tx storage
|
|||||||
committed := false
|
committed := false
|
||||||
defer func() {
|
defer func() {
|
||||||
if !committed {
|
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")
|
_, _ = conn.ExecContext(context.Background(), "ROLLBACK")
|
||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
@@ -1123,6 +1123,7 @@ func (t *sqliteTxStorage) getLabelsForIssues(ctx context.Context, issueIDs []str
|
|||||||
args[i] = id
|
args[i] = id
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// nolint:gosec // G201: placeholders is only "?" characters, not user input
|
||||||
query := fmt.Sprintf(`
|
query := fmt.Sprintf(`
|
||||||
SELECT issue_id, label FROM labels
|
SELECT issue_id, label FROM labels
|
||||||
WHERE issue_id IN (%s)
|
WHERE issue_id IN (%s)
|
||||||
|
|||||||
@@ -84,7 +84,7 @@ func IsBusyError(err error) bool {
|
|||||||
// - initialDelay: initial backoff delay (default: 10ms)
|
// - initialDelay: initial backoff delay (default: 10ms)
|
||||||
//
|
//
|
||||||
// Returns error if:
|
// Returns error if:
|
||||||
// - Context is cancelled
|
// - Context is canceled
|
||||||
// - BEGIN IMMEDIATE fails with non-busy error
|
// - BEGIN IMMEDIATE fails with non-busy error
|
||||||
// - All retries exhausted with SQLITE_BUSY
|
// - All retries exhausted with SQLITE_BUSY
|
||||||
func beginImmediateWithRetry(ctx context.Context, conn *sql.Conn, maxRetries int, initialDelay time.Duration) error {
|
func beginImmediateWithRetry(ctx context.Context, conn *sql.Conn, maxRetries int, initialDelay time.Duration) error {
|
||||||
|
|||||||
Reference in New Issue
Block a user