# README
go-archive
Extract files from archives in golang.
Import
import "github.com/mhristof/go-archive"
and go get github.com/mhristof/go-archive
Example
data, err := archive.NewURL(
"https://github.com/terraform-linters/tflint/releases/download/v0.31.0/tflint_darwin_amd64.zip"
).ExtractFile("tflint")
if err != nil {
panic(err)
}
err = os.WriteFile("tflint", data, 0755)
if err != nil {
panic(err)
}
# Functions
NewURL Create a new archive type from the given URL.
# Variables
ErrorDownload Error when there was an error while downloading the file.
ErrorFileNotFound Error returned when the file requested is not found in the archive.
ErrorUnsupportedArchive Error when the archive type is not supported.