Skip to content

Commit

Permalink
fix: close file (#404)
Browse files Browse the repository at this point in the history
Signed-off-by: guoguangwu <guoguangwug@gmail.com>
  • Loading branch information
testwill committed May 22, 2024
1 parent af48ae8 commit 5cb189c
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions cmd/gmailctl/cmd/edit_cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,15 @@ func moveFile(from, to string) error {
}
_, err = f.Write(b)
if err != nil {
_ = f.Close()
return err
}

err = f.Close()
if err != nil {
return err
}

return os.Remove(from)
}

Expand Down

0 comments on commit 5cb189c

Please sign in to comment.