mirror of
https://github.com/restic/restic.git
synced 2025-12-11 18:47:50 +00:00
centralize index progress bar for termstatus
This commit is contained in:
@@ -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...)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user