Skip to content

fix: check tmpFile.Close() error in external editor#1339

Open
MD-Mushfiqur123 wants to merge 1 commit into
floatpane:masterfrom
MD-Mushfiqur123:fix/unchecked-tmpfile-close
Open

fix: check tmpFile.Close() error in external editor#1339
MD-Mushfiqur123 wants to merge 1 commit into
floatpane:masterfrom
MD-Mushfiqur123:fix/unchecked-tmpfile-close

Conversation

@MD-Mushfiqur123
Copy link
Copy Markdown
Contributor

Fixes #728. Checked tmpFile.Close() error before opening external editor. If Close fails after writing temp file, the error is returned instead of being silently ignored.

@MD-Mushfiqur123 MD-Mushfiqur123 requested a review from a team as a code owner May 22, 2026 06:10
Copy link
Copy Markdown
Member

@floatpanebot floatpanebot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @MD-Mushfiqur123! Please fix the following issues with your PR:

  • Title: Is too long (51 characters). The PR title must be strictly under 40 characters.
  • Body: Missing the ## What? or ## Why? headings required by the PR template.

@floatpanebot floatpanebot added bug Something isn't working size/XS Diff: 0–10 lines labels May 22, 2026
Comment thread main.go
tmpPath := tmpFile.Name()

if _, err := tmpFile.WriteString(body); err != nil {
tmpFile.Close()
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tmpFile.Close() is still unchecked in the failed WriteString path. Please wrap the close too.

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

Labels

bug Something isn't working size/XS Diff: 0–10 lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

BUG: Unchecked tmpFile.Close() error in external editor

3 participants