Skip to content

Fix error closing files from Filesystem#18

Merged
mholt merged 2 commits intomholt:mainfrom
WillAbides:fserror
Feb 17, 2025
Merged

Fix error closing files from Filesystem#18
mholt merged 2 commits intomholt:mainfrom
WillAbides:fserror

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