zip

package module
v0.0.0-...-ea6be45 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 17, 2024 License: MIT Imports: 7 Imported by: 0

README

zip-go

The golang library archive/zip cannot compress some files except for some files. This is a zip file with a function to exclude some files.

Excluded files can also be specified by file format. Wildcards are also supported.

Usage

package main

import (
	"log"
	"path/filepath"

	zip "github.com/kenzo0107/zip-go"
)

func main() {
	excludeFilepath := filepath.Join("testdata", ".ignore")
	excludes, _ := zip.ExcludeFilepaths(excludeFilepath)

	targetDir := "testdata"
	zipFile := "testdata.zip"
	if err := zip.Compress(targetDir, zipFile, excludes); err != nil {
		log.Fatal(err)
	}
}

LICENSE

MIT License

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Compress

func Compress(src, dst string, excludeFilepaths []string) error

func ExcludeFilepaths

func ExcludeFilepaths(path string) ([]string, error)

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL