issue 7712: don't append nil error for BatchForget of restic path

Signed-off-by: Lyndon-Li <lyonghui@vmware.com>
This commit is contained in:
Lyndon-Li
2024-04-22 11:10:45 +08:00
parent bc29471ed6
commit 776efc4460

View File

@@ -82,7 +82,9 @@ func (r *resticRepositoryProvider) BatchForget(ctx context.Context, snapshotIDs
errs := []error{}
for _, snapshot := range snapshotIDs {
err := r.Forget(ctx, snapshot, param)
errs = append(errs, err)
if err != nil {
errs = append(errs, err)
}
}
return errs