Ensure files are closed after they are done being used

This commit is contained in:
Matthew Penner
2023-01-17 18:34:08 -07:00
parent 43b7aa2536
commit e9b8b11fec
4 changed files with 7 additions and 1 deletions

View File

@@ -85,6 +85,7 @@ func (b *LocalBackup) Restore(ctx context.Context, _ io.Reader, callback Restore
if err != nil {
return err
}
defer f.Close()
var reader io.Reader = f
// Steal the logic we use for making backups which will be applied when restoring