Skip to content

chore: defer file closes#1180

Open
Haroka-74 wants to merge 1 commit intofloatpane:masterfrom
Haroka-74:fix/issue-1056
Open

chore: defer file closes#1180
Haroka-74 wants to merge 1 commit intofloatpane:masterfrom
Haroka-74:fix/issue-1056

Conversation

@Haroka-74
Copy link
Copy Markdown
Contributor

What?

Replaced manual Close() calls on every error path in the binary copy block of runUpdateCLI with defer, and report close errors on out via the named return value.

Why?

The previous manual Close() calls on every return path were fragile and silently discarded flush errors on out.

Closes #1056

@Haroka-74 Haroka-74 requested a review from a team as a code owner April 27, 2026 19:04
@github-actions github-actions Bot added the bug Something isn't working label Apr 27, 2026
@andrinoff andrinoff changed the title fix: defer file closes in update CLI chore: defer file closes Apr 27, 2026
@github-actions github-actions Bot added the chore label Apr 27, 2026
@Haroka-74
Copy link
Copy Markdown
Contributor Author

@andrinoff

I need to change this if err := os.Rename(tmpNew, execPath); err != nil { to if err = os.Rename(tmpNew, execPath); err != nil {.

Am I right?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working chore

Projects

None yet

Development

Successfully merging this pull request may close these issues.

BUG: Manual Close() instead of defer leaks fds on error in update copy

1 participant