Browse code

Not doing extra assertion for io.Closer

Signed-off-by: Ian Babrou <ibobrik@gmail.com>

Ian Babrou authored on 2015/01/22 16:36:20
Showing 1 changed files
... ...
@@ -5,7 +5,6 @@ import (
5 5
 	"encoding/json"
6 6
 	"flag"
7 7
 	"fmt"
8
-	"io"
9 8
 	"io/ioutil"
10 9
 	"os"
11 10
 	"path/filepath"
... ...
@@ -60,11 +59,7 @@ func ApplyLayer(dest string, layer archive.ArchiveReader) (size int64, err error
60 60
 		return 0, err
61 61
 	}
62 62
 
63
-	defer func() {
64
-		if c, ok := decompressed.(io.Closer); ok {
65
-			c.Close()
66
-		}
67
-	}()
63
+	defer decompressed.Close()
68 64
 
69 65
 	cmd := reexec.Command("docker-applyLayer", dest)
70 66
 	cmd.Stdin = decompressed