Skip to content
This repository has been archived by the owner on Nov 19, 2024. It is now read-only.

Allow Identify to take a nil io.Reader #370

Merged
merged 2 commits into from
Feb 6, 2023
Merged

Conversation

ncw
Copy link
Contributor

@ncw ncw commented Feb 3, 2023

This PR contains two commits

  • Allow Identify to take a nil io.Reader

Allow Identify to take a nil io.Reader

The Match functions can all take a nil io.Reader to mean just identify
the archive from its file name, but before this patch Identify could
not.

This patch allows the stream to be nil, and enables Identify to be
used to create formats for archives which haven't been created yet
just from their file name.

  • Fix crash when Tar.Match is given a nil stream

The Match functions can all take a nil io.Reader to mean just identify
the archive from its file name, but before this patch Identify could
not.

This patch allows the stream to be nil, and enables Identify to be
used to create formats for archives which haven't been created yet
just from their file name.
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.

Interesting use case I hadn't thought of. Thanks for another great patch! 😃

@mholt mholt merged commit 70981de into mholt:master Feb 6, 2023
@ncw ncw deleted the fix-identify branch February 7, 2023 11:09
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants