manifest: use Sync instead of Close
This commit is contained in:
parent
c829e60649
commit
4c9f2b4ba4
1 changed files with 2 additions and 2 deletions
|
|
@ -41,13 +41,13 @@ func sbomWriter(outputDir, filename string, content io.Reader) error {
|
|||
if err != nil {
|
||||
return err
|
||||
}
|
||||
// ensure we do not leak FDs if the function returns prematurely
|
||||
defer f.Close()
|
||||
|
||||
if _, err := io.Copy(f, content); err != nil {
|
||||
return err
|
||||
}
|
||||
return f.Close()
|
||||
|
||||
return f.Sync()
|
||||
}
|
||||
|
||||
// used in tests
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue