centralize index progress bar for termstatus

This commit is contained in:
Michael Eischer
2025-09-13 23:17:15 +02:00
parent 6cdb9a75e6
commit 32b7168a9e
8 changed files with 29 additions and 12 deletions

View File

@@ -7,6 +7,7 @@ import "testing"
// It must be safe to call its methods from concurrent goroutines.
type Printer interface {
NewCounter(description string) *Counter
NewCounterTerminalOnly(description string) *Counter
// E prints to stderr
E(msg string, args ...interface{})
@@ -29,6 +30,10 @@ func (*NoopPrinter) NewCounter(_ string) *Counter {
return nil
}
func (*NoopPrinter) NewCounterTerminalOnly(_ string) *Counter {
return nil
}
func (*NoopPrinter) E(_ string, _ ...interface{}) {}
func (*NoopPrinter) S(_ string, _ ...interface{}) {}
@@ -56,6 +61,10 @@ func (p *TestPrinter) NewCounter(_ string) *Counter {
return nil
}
func (p *TestPrinter) NewCounterTerminalOnly(_ string) *Counter {
return nil
}
func (p *TestPrinter) E(msg string, args ...interface{}) {
p.t.Logf("error: "+msg, args...)
}