Skip to content
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

Fix error closing files from Filesystem #18

Merged
merged 2 commits into from
Feb 17, 2025
Merged

Conversation

WillAbides
Copy link
Contributor

Fixes #17

The underlying issue for #17 was a typed nil bug. A nil *os.File was being assigned to closeBoth.c which is an io.Closer. So this non-nil check will always be true even when the original *os.File is nil.

The solution in this PR is only make fsFile a closeBoth when archiveFile != nil.

Copy link
Owner

@mholt mholt left a comment

Choose a reason for hiding this comment

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

Ah, nice find. Thanks for the patch!

@mholt mholt merged commit 335037c into mholt:main Feb 17, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Error closing files from Filesystem
2 participants