mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-26 21:17:23 +00:00
Fix error check logic
If copy finished file (err == nil) then use the error returned from out.Close()
This commit is contained in:
parent
1fa20301a0
commit
b75ea1b052
@ -171,7 +171,7 @@ func copyFile(src, dst string) (err error) {
|
|||||||
}
|
}
|
||||||
defer func() {
|
defer func() {
|
||||||
cerr := out.Close()
|
cerr := out.Close()
|
||||||
if cerr == nil {
|
if err == nil {
|
||||||
err = cerr
|
err = cerr
|
||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
|
Loading…
Reference in New Issue
Block a user