https://github.com/dreamph/gozip
Golang Zip/Unzip File
https://github.com/dreamph/gozip
golang golangzip unzip zip zipdirectory zipfile
Last synced: 3 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 (10 months ago)
- Default Branch: main
- Last Pushed: 2024-08-22T11:29:32.000Z (9 months ago)
- Last Synced: 2025-01-03T23:27:00.132Z (5 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
=======
[](https://www.buymeacoffee.com/dreamph)