From 2a95591b481351fb55b2069878db499194a42cb2 Mon Sep 17 00:00:00 2001 From: Michael Eischer Date: Sat, 30 May 2026 10:11:18 +0200 Subject: [PATCH] index: replace custom EachByPackResult datatype --- internal/repository/index/index.go | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/internal/repository/index/index.go b/internal/repository/index/index.go index 652224d77..e96530ec1 100644 --- a/internal/repository/index/index.go +++ b/internal/repository/index/index.go @@ -228,11 +228,6 @@ func (idx *Index) Values() iter.Seq[restic.PackedBlob] { } } -type EachByPackResult struct { - PackID restic.ID - Blobs restic.Blobs -} - // EachByPack returns a channel that yields all blobs known to the index // grouped by packID but ignoring blobs with a packID in packPlacklist for // finalized indexes. @@ -240,10 +235,10 @@ type EachByPackResult struct { // from the finalized index which have been re-read into a non-finalized index. // When the context is cancelled, the background goroutine // terminates. This blocks any modification of the index. -func (idx *Index) EachByPack(ctx context.Context, packBlacklist restic.IDSet) <-chan EachByPackResult { +func (idx *Index) EachByPack(ctx context.Context, packBlacklist restic.IDSet) <-chan restic.PackBlobs { idx.m.RLock() - ch := make(chan EachByPackResult) + ch := make(chan restic.PackBlobs) go func() { defer idx.m.RUnlock() @@ -264,7 +259,7 @@ func (idx *Index) EachByPack(ctx context.Context, packBlacklist restic.IDSet) <- } for packID, packByType := range byPack { - var result EachByPackResult + var result restic.PackBlobs result.PackID = packID for typ, p := range packByType { for _, e := range p {