gen2brain / go-unarr

Go bindings for unarr (decompression library for RAR, TAR, ZIP and 7z archives)
zlib License
282 stars 44 forks source link

Why include zlib, lzma, bzip2, tar, zip etc? #13

Closed coolaj86 closed 4 years ago

coolaj86 commented 4 years ago

The reason that I'm using this is for a cross-platform un7z, which has not been implemented in a language that can be easily cross-compiled.

Go has builtin natives for:

And other native Go code for most other formats:

Is there are reason that all of these already-go-native formats are included in this project?

gen2brain commented 4 years ago

Well, yes, this is a wrapper for unarr library, that supports all those formats. In order to remove support, the code must be changed to work without those libs, if it would be enough to not include some files something can be done with tags, i.e. nozlib etc. But how it is, it would need a lot of work just to remove a few KB. If one doesn't want to use it for zip or tar, then just don't use it and use native libs instead :) I think it is also nice to have an alternative in C, so it can be compared. Also, usually native Go libs are a lot slower (i.e. libjpeg-turbo vs image/jpeg is 5x faster).

coolaj86 commented 4 years ago

Makes perfect sense. Thanks.