mirror of https://github.com/docker/cli.git
build: simplify Close logic in WriteTempDockerfile
Signed-off-by: Tibor Vass <tibor@docker.com>
This commit is contained in:
parent
ed75f6202b
commit
15674d9ee9
|
@ -111,12 +111,8 @@ func WriteTempDockerfile(rc io.ReadCloser) (string, error) {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", err
|
return "", err
|
||||||
}
|
}
|
||||||
_, err = io.Copy(f, rc)
|
defer f.Close()
|
||||||
if err != nil {
|
if _, err := io.Copy(f, rc); err != nil {
|
||||||
f.Close()
|
|
||||||
return "", err
|
|
||||||
}
|
|
||||||
if err := f.Close(); err != nil {
|
|
||||||
return "", err
|
return "", err
|
||||||
}
|
}
|
||||||
return dockerfileDir, rc.Close()
|
return dockerfileDir, rc.Close()
|
||||||
|
|
Loading…
Reference in New Issue