-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WriteFile ignores Close() error #7
Comments
Yes, it's fine, See this comment on
https://github.com/dchest/safefile/blob/master/safefile.go#L102 (If the file was not committed, you'll get the error from Thanks for code review anyway! |
Actually, you're right: we won't detect a failure to remove file if renaming fails. https://github.com/dchest/safefile/blob/master/safefile.go#L124 |
... ah, but in this case, we still get the actual error indicating that rename failed. So, there will be an error anyway 🤷♂️ |
Maybe it's fine, but
defer f.Close()
can end up ignoring an error if f.Close() returns one. Maybe this is fine since we're already returning an error if f.Close() returns a non-nil err and it would be hard to return two errors at once.The text was updated successfully, but these errors were encountered: