diff --git a/cli/command/container/hijack.go b/cli/command/container/hijack.go index 7ecf5f5057..cd91e69514 100644 --- a/cli/command/container/hijack.go +++ b/cli/command/container/hijack.go @@ -87,7 +87,7 @@ func (h *hijackedIOStreamer) setupInput() (restore func(), err error) { var restoreOnce sync.Once restore = func() { restoreOnce.Do(func() { - restoreTerminal(h.streams, h.inputStream) + _ = restoreTerminal(h.streams, h.inputStream) }) } diff --git a/cli/command/image/build/context.go b/cli/command/image/build/context.go index c4deef7e08..b029a60095 100644 --- a/cli/command/image/build/context.go +++ b/cli/command/image/build/context.go @@ -161,13 +161,13 @@ func GetContextFromReader(rc io.ReadCloser, dockerfileName string) (out io.ReadC return nil, "", err } - tar, err := archive.Tar(dockerfileDir, archive.Uncompressed) + tarArchive, err := archive.Tar(dockerfileDir, archive.Uncompressed) if err != nil { return nil, "", err } - return ioutils.NewReadCloserWrapper(tar, func() error { - err := tar.Close() + return ioutils.NewReadCloserWrapper(tarArchive, func() error { + err := tarArchive.Close() os.RemoveAll(dockerfileDir) return err }), DefaultDockerfileName, nil @@ -432,8 +432,7 @@ func Compress(buildCtx io.ReadCloser) (io.ReadCloser, error) { defer buildCtx.Close() if _, err := pools.Copy(compressWriter, buildCtx); err != nil { - pipeWriter.CloseWithError( - errors.Wrap(err, "failed to compress context")) + pipeWriter.CloseWithError(errors.Wrap(err, "failed to compress context")) compressWriter.Close() return }