Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dreamph/gozip
Golang Zip/Unzip File
https://github.com/dreamph/gozip
golang golangzip unzip zip zipdirectory zipfile
Last synced: about 2 months ago
JSON representation
Golang Zip/Unzip File
- Host: GitHub
- URL: https://github.com/dreamph/gozip
- Owner: dreamph
- License: mit
- Created: 2024-08-02T05:01:21.000Z (5 months ago)
- Default Branch: main
- Last Pushed: 2024-08-22T11:29:32.000Z (4 months ago)
- Last Synced: 2024-08-22T12:58:52.100Z (4 months ago)
- Topics: golang, golangzip, unzip, zip, zipdirectory, zipfile
- Language: Go
- Homepage:
- Size: 6.84 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# gozip
Golang Zip File
- Simple, Easy
- Support File or DirectoryExample
=======
```go
package mainimport (
"github.com/dreamph/gozip"
"log"
)func main() {
// Zip
err := gozip.Zip("example/output/test.zip", []string{"example/dir1", "example/test-file.txt"})
if err != nil {
log.Fatal("Zip file error.", err)
}// Zip with password
err = gozip.Zip("example/output/test-with-password.zip", []string{"example/dir1", "example/test-file.txt"}, "password")
if err != nil {
log.Fatal("Zip file error.", err)
}// Unzip
err = gozip.Unzip("example/output/test.zip", "example/output/test")
if err != nil {
log.Fatal("Zip file error.", err)
}// Unzip with password
err = gozip.Unzip("example/output/test-with-password.zip", "example/output/test-with-password", "password")
if err != nil {
log.Fatal("Zip file error.", err)
}
}
```Buy Me a Coffee
=======
[!["Buy Me A Coffee"](https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png)](https://www.buymeacoffee.com/dreamph)