/usr/share/gocode/src/github.com/hashicorp/go-getter/decompress.go is in golang-github-hashicorp-go-getter-dev 0.0~git20160316.0.575ec4e-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | package getter
// Decompressor defines the interface that must be implemented to add
// support for decompressing a type.
type Decompressor interface {
// Decompress should decompress src to dst. dir specifies whether dst
// is a directory or single file. src is guaranteed to be a single file
// that exists. dst is not guaranteed to exist already.
Decompress(dst, src string, dir bool) error
}
// Decompressors is the mapping of extension to the Decompressor implementation
// that will decompress that extension/type.
var Decompressors map[string]Decompressor
func init() {
tbzDecompressor := new(TarBzip2Decompressor)
tgzDecompressor := new(TarGzipDecompressor)
Decompressors = map[string]Decompressor{
"bz2": new(Bzip2Decompressor),
"gz": new(GzipDecompressor),
"tar.bz2": tbzDecompressor,
"tar.gz": tgzDecompressor,
"tbz2": tbzDecompressor,
"tgz": tgzDecompressor,
"zip": new(ZipDecompressor),
}
}
|