-
Notifications
You must be signed in to change notification settings - Fork 36
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
Split up archive.go into type-specific files; add wider zlib support #723
Conversation
Signed-off-by: egibs <[email protected]>
pkg/action/archive.go
Outdated
func extractNestedArchive( | ||
ctx context.Context, | ||
d string, | ||
f string, | ||
extracted *sync.Map, | ||
) error { | ||
isArchive := false | ||
ext := getExt(f) | ||
if _, ok := archiveMap[ext]; ok { | ||
// zlib-compressed files are also archives |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These lines, L101-112, L152-162, and the additions in zlib.go
are the only material changes in this PR. The rest are just moving existing code into new files (and updating the debug logging in gzip.go
.
It looks good; what do you think about moving this out of |
I ran into some circular imports earlier but I can give it a try. |
Updated in I left |
Signed-off-by: egibs <[email protected]>
43b922d
to
34cab39
Compare
This PR splits up all of the archive-specific functions in
archive.go
into their own respective files for readability.As part of this, I also added extension-agnostic
zlib
support depending on whether the file returns&{.Z, application/zlib}
fromprogramkind.File
.I also fixed a panic:
This was happening because we were trying to print
ft.Ext
debug logs for files that returnednil
fromprogramkind.File
.