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 8a4446c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion cmd/archive.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,12 @@ An archive is a fully self-contained test run, and can be executed identically e
if err != nil {
return err
}
return arc.Write(f)

err = arc.Write(f)
if cerr := f.Close(); err == nil && cerr != nil {
err = cerr
}
return err
},
}

Expand Down

0 comments on commit 8a4446c

Please sign in to comment.