restic: move Printer interface from internal/ui/progress

Move Printer and NewNoopPrinter to internal/restic so repository does
not have to import the ui packages.
This commit is contained in:
Michael Eischer
2026-06-20 17:49:20 +02:00
parent 0f4236cb39
commit d9d54a505e
44 changed files with 165 additions and 173 deletions
+3 -2
View File
@@ -1,6 +1,7 @@
package restore
import (
"github.com/restic/restic/internal/restic"
"testing"
"time"
@@ -37,7 +38,7 @@ type mockPrinter struct {
trace printerTrace
items itemTrace
errors errorTrace
progress.Printer
restic.Printer
}
const mockFinishDuration = 42 * time.Second
@@ -57,7 +58,7 @@ func (p *mockPrinter) Finish(progress State, _ time.Duration) {
}
func testProgress(fn func(progress *Progress) bool) (printerTrace, itemTrace, errorTrace) {
printer := &mockPrinter{Printer: progress.NewNoopPrinter()}
printer := &mockPrinter{Printer: restic.NewNoopPrinter()}
progress := newProgress(printer, 0)
final := fn(progress)
progress.update(0, final)