From aee73d745df4c5feb8dd1b1b2596a2a498101bda Mon Sep 17 00:00:00 2001 From: Adrien Delorme Date: Wed, 10 Apr 2019 15:42:02 +0200 Subject: [PATCH] update code after go mod update --- builder/amazon/chroot/builder.go | 1 - builder/amazon/chroot/builder_test.go | 3 ++- post-processor/compress/post-processor.go | 5 ++--- website/source/docs/extending/plugins.html.md | 2 +- 4 files changed, 5 insertions(+), 6 deletions(-) diff --git a/builder/amazon/chroot/builder.go b/builder/amazon/chroot/builder.go index 60f127704..5dd679564 100644 --- a/builder/amazon/chroot/builder.go +++ b/builder/amazon/chroot/builder.go @@ -102,7 +102,6 @@ func (b *Builder) Prepare(raws ...interface{}) ([]string, error) { // set default copy file if we're not giving our own if b.config.CopyFiles == nil { - b.config.CopyFiles = make([]string, 0) if !b.config.FromScratch { b.config.CopyFiles = []string{"/etc/resolv.conf"} } diff --git a/builder/amazon/chroot/builder_test.go b/builder/amazon/chroot/builder_test.go index 1fcc905f1..e6999bff6 100644 --- a/builder/amazon/chroot/builder_test.go +++ b/builder/amazon/chroot/builder_test.go @@ -159,7 +159,8 @@ func TestBuilderPrepare_CopyFilesNoDefault(t *testing.T) { } if len(b.config.CopyFiles) > 0 { - t.Errorf("Was expecting no default value for copy_files.") + t.Errorf("Was expecting no default value for copy_files. Found %v", + b.config.CopyFiles) } } diff --git a/post-processor/compress/post-processor.go b/post-processor/compress/post-processor.go index 72ccec60c..be60e9897 100644 --- a/post-processor/compress/post-processor.go +++ b/post-processor/compress/post-processor.go @@ -3,7 +3,6 @@ package compress import ( "archive/tar" "archive/zip" - "compress/gzip" "context" "fmt" "io" @@ -273,8 +272,8 @@ func makeBGZFWriter(output io.WriteCloser, compressionLevel int) (io.WriteCloser func makeLZ4Writer(output io.WriteCloser, compressionLevel int) (io.WriteCloser, error) { lzwriter := lz4.NewWriter(output) - if compressionLevel > gzip.DefaultCompression { - lzwriter.Header.HighCompression = true + if compressionLevel > 0 { + lzwriter.Header.CompressionLevel = compressionLevel } return lzwriter, nil } diff --git a/website/source/docs/extending/plugins.html.md b/website/source/docs/extending/plugins.html.md index 901bfc91b..b375a7e86 100644 --- a/website/source/docs/extending/plugins.html.md +++ b/website/source/docs/extending/plugins.html.md @@ -160,7 +160,7 @@ using standard installation procedures. The specifics of how to implement each type of interface are covered in the relevant subsections available in the navigation to the left. -\~> **Lock your dependencies!** Using `govendor` is highly recommended since +\~> **Lock your dependencies!** Using `go mod` is highly recommended since the Packer codebase will continue to improve, potentially breaking APIs along the way until there is a stable release. By locking your dependencies, your plugins will continue to work with the version of Packer you lock to.