Fix lint errors: handle error return values

This commit is contained in:
Steve Yegge
2025-11-15 12:52:34 -08:00
parent 690c73fc31
commit 6f7e7fa930
6 changed files with 10 additions and 10 deletions

View File

@@ -54,7 +54,7 @@ func merge3WayAndPruneDeletions(ctx context.Context, store storage.Storage, json
// Ensure temp file cleanup on failure
defer func() {
if fileExists(tmpMerged) {
os.Remove(tmpMerged)
_ = os.Remove(tmpMerged)
}
}()

View File

@@ -545,7 +545,7 @@ func attemptAutoMerge(conflictedPath string) error {
if err != nil {
return fmt.Errorf("failed to create temp directory: %w", err)
}
defer os.RemoveAll(tmpDir)
defer func() { _ = os.RemoveAll(tmpDir) }()
basePath := filepath.Join(tmpDir, "base.jsonl")
leftPath := filepath.Join(tmpDir, "left.jsonl")

View File

@@ -202,7 +202,7 @@ func sendAgentMailRequest(config *AgentMailConfig, method string, params interfa
if err != nil {
return nil, fmt.Errorf("failed to connect to Agent Mail server: %w", err)
}
defer resp.Body.Close()
defer func() { _ = resp.Body.Close() }()
body, err := io.ReadAll(resp.Body)
if err != nil {

View File

@@ -630,7 +630,7 @@ func displayMigrationPlan(plan migrationPlan, dryRun bool) error {
func confirmMigration(plan migrationPlan) bool {
fmt.Printf("\nMigrate %d issues from %s to %s? [y/N] ", len(plan.IssueIDs), plan.From, plan.To)
var response string
fmt.Scanln(&response)
_, _ = fmt.Scanln(&response)
return strings.ToLower(strings.TrimSpace(response)) == "y"
}
@@ -698,6 +698,6 @@ func init() {
migrateIssuesCmd.Flags().Bool("strict", false, "Fail on orphaned dependencies or missing repos")
migrateIssuesCmd.Flags().Bool("yes", false, "Skip confirmation prompt")
migrateIssuesCmd.MarkFlagRequired("from")
migrateIssuesCmd.MarkFlagRequired("to")
_ = migrateIssuesCmd.MarkFlagRequired("from")
_ = migrateIssuesCmd.MarkFlagRequired("to")
}

View File

@@ -607,11 +607,11 @@ Examples:
// Write current value to temp file
if _, err := tmpFile.WriteString(currentValue); err != nil {
tmpFile.Close()
_ = tmpFile.Close()
fmt.Fprintf(os.Stderr, "Error writing to temp file: %v\n", err)
os.Exit(1)
}
tmpFile.Close()
_ = tmpFile.Close()
// Open the editor
editorCmd := exec.Command(editor, tmpPath)