From 776efc4460f26b6b4fec8f7e9505d68e126ab55d Mon Sep 17 00:00:00 2001 From: Lyndon-Li Date: Mon, 22 Apr 2024 11:10:45 +0800 Subject: [PATCH] issue 7712: don't append nil error for BatchForget of restic path Signed-off-by: Lyndon-Li --- pkg/repository/provider/restic.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkg/repository/provider/restic.go b/pkg/repository/provider/restic.go index decc3af15..3ca5988cb 100644 --- a/pkg/repository/provider/restic.go +++ b/pkg/repository/provider/restic.go @@ -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