From eec1af54d1eb8b7b2faa95bc077994190db32c6f Mon Sep 17 00:00:00 2001 From: Ian Babrou Date: Thu, 22 Jan 2015 10:36:20 +0300 Subject: [PATCH] Not doing extra assertion for io.Closer Signed-off-by: Ian Babrou --- chrootarchive/diff.go | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/chrootarchive/diff.go b/chrootarchive/diff.go index ac1cbf9..8d97c76 100644 --- a/chrootarchive/diff.go +++ b/chrootarchive/diff.go @@ -5,7 +5,6 @@ import ( "encoding/json" "flag" "fmt" - "io" "io/ioutil" "os" "path/filepath" @@ -60,11 +59,7 @@ func ApplyLayer(dest string, layer archive.ArchiveReader) (size int64, err error return 0, err } - defer func() { - if c, ok := decompressed.(io.Closer); ok { - c.Close() - } - }() + defer decompressed.Close() cmd := reexec.Command("docker-applyLayer", dest) cmd.Stdin = decompressed