We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent eea47c1 commit f9cdf1cCopy full SHA for f9cdf1c
pkg/distribution/packaging/dirtar.go
@@ -79,12 +79,16 @@ func CreateDirectoryTarArchive(dirPath string) (string, error) {
79
if err != nil {
80
return fmt.Errorf("open file %s: %w", path, err)
81
}
82
- defer file.Close()
+
83
84
// Copy file contents
85
if _, err := io.Copy(tw, file); err != nil {
86
+ file.Close()
87
return fmt.Errorf("write tar content for %s: %w", path, err)
88
89
+ if err := file.Close(); err != nil {
90
+ return fmt.Errorf("close file %s: %w", path, err)
91
+ }
92
93
94
return nil
0 commit comments