Skip to content

Commit

Permalink
Ensure archive file is closed after writing
Browse files Browse the repository at this point in the history
  • Loading branch information
na-- committed Mar 5, 2022
1 parent 1e28a3e commit 149aa60
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions cmd/archive.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,12 @@ An archive is a fully self-contained test run, and can be executed identically e
if err != nil {
return err
}
defer func() { //nolint:gosec
cerr := f.Close()
if err == nil && cerr != nil {
err = cerr
}
}()
return arc.Write(f)
},
}
Expand Down

0 comments on commit 149aa60

Please sign in to comment.