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

Allow Identify to take a nil io.Reader - #370

Merged
mholt merged 2 commits into
mholt:masterfrom
ncw:fix-identify
Feb 6, 2023
Merged

mholt merged 2 commits into
mholt:masterfrom
ncw:fix-identify

Conversation

@ncw

@ncw ncw commented Feb 3, 2023

Copy link
Copy Markdown
Contributor

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

ncw added 2 commits February 3, 2023 11:10
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.

@mholt mholt left a comment

Copy link
Copy Markdown
Owner

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

⌂ 换网址