tarutil

package
v0.13.5 Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrEmptySubdir = errors.New("empty tarball subdirectory")

Functions

func Extract

func Extract(r io.Reader, dir string) error

Extract reads the tarball from r and writes it into dir. Copied and modified from golang.org/x/build/internal/untar.

func Subdir added in v0.9.0

func Subdir(r io.Reader, subdir string) io.ReadCloser

Subdir reads the tarball from r and streams the files in the given subdirectory to the returned io.ReadCloser as a tarball with the subdirectory's path trimmed from each file's name.

If the subdirectory is empty or non-existent, the returned io.ReadCloser is closed with ErrEmptySubdir.

Types

This section is empty.

Jump to

Keyboard shortcuts

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