Fix lint errors: handle error return values
This commit is contained in:
@@ -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)
|
||||
}
|
||||
}()
|
||||
|
||||
|
||||
@@ -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")
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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")
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user