https://github.com/dreamph/gozip
Golang Zip/Unzip File
https://github.com/dreamph/gozip
golang golangzip unzip zip zipdirectory zipfile
Last synced: over 1 year 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 (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-08-22T11:29:32.000Z (almost 2 years ago)
- Last Synced: 2025-01-03T23:27:00.132Z (over 1 year 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 Directory
Example
=======
```go
package main
import (
"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)