Not doing extra assertion for io.Closer

Signed-off-by: Ian Babrou <ibobrik@gmail.com>
This commit is contained in:
Ian Babrou 2015-01-22 10:36:20 +03:00
parent feb02197c1
commit eec1af54d1

View file

@ -5,7 +5,6 @@ import (
"encoding/json" "encoding/json"
"flag" "flag"
"fmt" "fmt"
"io"
"io/ioutil" "io/ioutil"
"os" "os"
"path/filepath" "path/filepath"
@ -60,11 +59,7 @@ func ApplyLayer(dest string, layer archive.ArchiveReader) (size int64, err error
return 0, err return 0, err
} }
defer func() { defer decompressed.Close()
if c, ok := decompressed.(io.Closer); ok {
c.Close()
}
}()
cmd := reexec.Command("docker-applyLayer", dest) cmd := reexec.Command("docker-applyLayer", dest)
cmd.Stdin = decompressed cmd.Stdin = decompressed