Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions slug.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,12 @@ func Pack(src string, w io.Writer, dereference bool) (*Meta, error) {
// from the slug.
func (p *Packer) Pack(src string, w io.Writer) (*Meta, error) {
// Gzip compress all the output data.
gzipW := gzip.NewWriter(w)
gzipW, err := gzip.NewWriterLevel(w, gzip.BestSpeed)
if err != nil {
// This error is only raised when an incorrect gzip level is
// specified.
return nil, err
}

// Tar the file contents.
tarW := tar.NewWriter(gzipW)
Expand All @@ -132,7 +137,7 @@ func (p *Packer) Pack(src string, w io.Writer) (*Meta, error) {
meta := &Meta{}

// Walk the tree of files.
err := filepath.Walk(src, p.packWalkFn(src, src, src, tarW, meta, ignoreRules))
err = filepath.Walk(src, p.packWalkFn(src, src, src, tarW, meta, ignoreRules))
if err != nil {
return nil, err
}
Expand Down