fix: Address all errcheck and misspell linter errors

This commit is contained in:
Steve Yegge
2025-11-01 23:56:03 -07:00
parent a2361f85e7
commit 2b086951c4
15 changed files with 61 additions and 60 deletions
+3 -3
View File
@@ -163,7 +163,7 @@ func discoverDaemon(socketPath string) DaemonInfo {
}
return daemon
}
defer client.Close()
defer func() { _ = client.Close() }()
// Get status
status, err := client.Status()
@@ -264,7 +264,7 @@ func StopDaemon(daemon DaemonInfo) error {
// Try graceful shutdown via RPC first
client, err := rpc.TryConnectWithTimeout(daemon.SocketPath, 500*time.Millisecond)
if err == nil && client != nil {
defer client.Close()
defer func() { _ = client.Close() }()
if err := client.Shutdown(); err == nil {
// Wait a bit for daemon to shut down
time.Sleep(200 * time.Millisecond)
@@ -334,7 +334,7 @@ func stopDaemonWithTimeout(daemon DaemonInfo) error {
// Try RPC shutdown first (2 second timeout)
client, err := rpc.TryConnectWithTimeout(daemon.SocketPath, 2*time.Second)
if err == nil && client != nil {
defer client.Close()
defer func() { _ = client.Close() }()
if err := client.Shutdown(); err == nil {
// Wait and verify process died
time.Sleep(500 * time.Millisecond)
+1 -1
View File
@@ -20,7 +20,7 @@ func newTestStore(t *testing.T, dbPath string) *sqlite.SQLiteStorage {
// CRITICAL (bd-166): Set issue_prefix to prevent "database not initialized" errors
ctx := context.Background()
if err := store.SetConfig(ctx, "issue_prefix", "bd"); err != nil {
store.Close()
_ = store.Close()
t.Fatalf("Failed to set issue_prefix: %v", err)
}
+10 -10
View File
@@ -126,17 +126,17 @@ func compareIssues(existing, incoming *types.Issue) []string {
// hashIssueContent creates a deterministic hash of issue content (excluding ID and timestamps)
func hashIssueContent(issue *types.Issue) string {
h := sha256.New()
fmt.Fprintf(h, "title:%s\n", issue.Title)
fmt.Fprintf(h, "description:%s\n", issue.Description)
fmt.Fprintf(h, "status:%s\n", issue.Status)
fmt.Fprintf(h, "priority:%d\n", issue.Priority)
fmt.Fprintf(h, "type:%s\n", issue.IssueType)
fmt.Fprintf(h, "assignee:%s\n", issue.Assignee)
fmt.Fprintf(h, "design:%s\n", issue.Design)
fmt.Fprintf(h, "acceptance:%s\n", issue.AcceptanceCriteria)
fmt.Fprintf(h, "notes:%s\n", issue.Notes)
_, _ = fmt.Fprintf(h, "title:%s\n", issue.Title)
_, _ = fmt.Fprintf(h, "description:%s\n", issue.Description)
_, _ = fmt.Fprintf(h, "status:%s\n", issue.Status)
_, _ = fmt.Fprintf(h, "priority:%d\n", issue.Priority)
_, _ = fmt.Fprintf(h, "type:%s\n", issue.IssueType)
_, _ = fmt.Fprintf(h, "assignee:%s\n", issue.Assignee)
_, _ = fmt.Fprintf(h, "design:%s\n", issue.Design)
_, _ = fmt.Fprintf(h, "acceptance:%s\n", issue.AcceptanceCriteria)
_, _ = fmt.Fprintf(h, "notes:%s\n", issue.Notes)
if issue.ExternalRef != nil {
fmt.Fprintf(h, "external_ref:%s\n", *issue.ExternalRef)
_, _ = fmt.Fprintf(h, "external_ref:%s\n", *issue.ExternalRef)
}
return fmt.Sprintf("%x", h.Sum(nil))
}
+1 -1
View File
@@ -18,7 +18,7 @@ func newTestStore(t *testing.T, dbPath string) *SQLiteStorage {
// CRITICAL (bd-166): Set issue_prefix to prevent "database not initialized" errors
ctx := context.Background()
if err := store.SetConfig(ctx, "issue_prefix", "bd"); err != nil {
store.Close()
_ = store.Close()
t.Fatalf("Failed to set issue_prefix: %v", err)
}
+1 -1
View File
@@ -21,6 +21,6 @@ func ExtractIssueNumber(issueID string) int {
return 0
}
var num int
fmt.Sscanf(issueID[idx+1:], "%d", &num)
_, _ = fmt.Sscanf(issueID[idx+1:], "%d", &num)
return num
}