mirror of
https://github.com/restic/restic.git
synced 2025-08-20 08:57:29 +00:00
Deduplicate dumper closing logic
This commit is contained in:
@@ -21,13 +21,10 @@ var _ dumper = zipDumper{}
|
||||
func WriteZip(ctx context.Context, repo restic.Repository, tree *restic.Tree, rootPath string, dst io.Writer) error {
|
||||
dmp := zipDumper{w: zip.NewWriter(dst)}
|
||||
|
||||
err := writeDump(ctx, repo, tree, rootPath, dmp, dst)
|
||||
if err != nil {
|
||||
dmp.w.Close()
|
||||
|
||||
return err
|
||||
}
|
||||
return writeDump(ctx, repo, tree, rootPath, dmp, dst)
|
||||
}
|
||||
|
||||
func (dmp zipDumper) Close() error {
|
||||
return dmp.w.Close()
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user