https://github.com/pkg6/archive
A simple Go archiving library.
https://github.com/pkg6/archive
Last synced: 3 months ago
JSON representation
A simple Go archiving library.
- Host: GitHub
- URL: https://github.com/pkg6/archive
- Owner: pkg6
- License: apache-2.0
- Created: 2025-02-08T05:53:18.000Z (3 months ago)
- Default Branch: main
- Last Pushed: 2025-02-08T06:26:29.000Z (3 months ago)
- Last Synced: 2025-02-08T07:24:39.171Z (3 months ago)
- Language: Go
- Size: 14.6 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## archive
A simple Go archiving library.## Example usage
~~~
package mainimport (
"github.com/pkg6/archive"
"log"
"os"
)func main() {
file, err := os.Create("file.zip")
if err != nil {
// deal with the error
}
zip, err := archive.New(file, "zip")
if err != nil {
log.Fatal(err)
}
defer zip.Close()
zip.Add(archive.File{
Destination: "file.txt",
Source: "/path/to/file.txt",
})
}
~~~## Support compression format
- tar.gz
- tgz
- tar
- gz
- tar.xz
- txz
- tar.zst
- tzst
- zip