// Make creates a .tar.xz file at xzPath containing
// the contents of files listed in filePaths. File
// paths can be those of regular files or directories.
// Regular files are stored at the 'root' of the
// archive, and directories are recursively added.
Make creates a .tar.xz file at xzPath containing
the contents of files listed in filePaths. File
paths can be those of regular files or directories.
Regular files are stored at the 'root' of the
archive, and directories are recursively added.
// Make creates a . tar . xz file at xzPath containing // the contents of files listed in filePaths . File // paths can be those of regular files or directories . // Regular files are stored at the ' root ' of the // archive and directories are recursively added .
func (xzFormat) Make(xzPath string, filePaths []string) error {
	out, err := os.Create(xzPath)
	if err != nil {
		return fmt.Errorf("error creating %s: %v", xzPath, err)
	}
	defer out.Close()
	xzWriter, err := xz.NewWriter(out)
	if err != nil {
		return fmt.Errorf("error compressing %s: %v", xzPath, err)
	}
	defer xzWriter.Close()
	tarWriter := tar.NewWriter(xzWriter)
	defer tarWriter.Close()
	return tarball(filePaths, tarWriter, xzPath)
}
func ( xzFormat ) Make ( xzPath string , filePaths [ ] string ) error { out , err := os . Create ( xzPath ) if err != nil { return fmt . Errorf ( " " , xzPath , err ) } defer out . Close ( ) xzWriter , err := xz . NewWriter ( out ) if err != nil { return fmt . Errorf ( " " , xzPath , err ) } defer xzWriter . Close ( ) tarWriter := tar . NewWriter ( xzWriter ) defer tarWriter . Close ( ) return tarball ( filePaths , tarWriter , xzPath ) }
Make creates a .tar.xz file at xzPath containing
the contents of files listed in filePaths.
Make creates a . tar . xz file at xzPath containing the contents of files listed in filePaths .