Documentation ¶
Overview ¶
Package uncompress permits seamless opening of compressed input files.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Exts = map[string]Opener{
"Z": gzipOpener,
"z": gzipOpener,
"gz": gzipOpener,
"bz2": bzip2Opener,
"xz": xzOpener,
}
Exts maps a file suffix to the name of the program to use in OpenFile for uncompressing it. Callers may modify Exts as needed.
Functions ¶
func Open ¶
func Open(name string) (io.ReadCloser, error)
Open opens the named file for reading. If the file name has one of several special suffixes, the resulting ReadCloser contains the result of uncompressing the file contents, using the uncompressing method determined by Exts. If the file does not have a suffix from Exts, OpenFile falls back to using os.Open.
Types ¶
type Opener ¶
type Opener = func(io.ReadCloser) (io.ReadCloser, error)
An Opener receives a ReadCloser with compressed data and returns a ReadCloser with uncompressed data.
Click to show internal directories.
Click to hide internal directories.