index: convert to implement modern go iterators

This commit is contained in:
Michael Eischer
2025-10-10 23:16:20 +02:00
parent 0624b656b8
commit 38c543457e
11 changed files with 125 additions and 102 deletions
+6 -2
View File
@@ -73,9 +73,13 @@ func runList(ctx context.Context, gopts global.Options, args []string, term ui.T
if err != nil {
return err
}
return idx.Each(ctx, func(blobs restic.PackedBlob) {
for blobs := range idx.Values() {
if ctx.Err() != nil {
return ctx.Err()
}
printer.S("%v %v", blobs.Type, blobs.ID)
})
}
return nil
})
default:
return errors.Fatal("invalid type")