diff --git a/cmd/restic/termstatus.go b/cmd/restic/termstatus.go index 633e4521c..c0e9a045b 100644 --- a/cmd/restic/termstatus.go +++ b/cmd/restic/termstatus.go @@ -4,7 +4,6 @@ import ( "context" "sync" - "github.com/restic/restic/internal/ui" "github.com/restic/restic/internal/ui/termstatus" ) @@ -31,7 +30,7 @@ func setupTermstatus() (*termstatus.Terminal, func()) { // use the termstatus for stdout/stderr prevStdout, prevStderr := globalOptions.stdout, globalOptions.stderr - globalOptions.stdout, globalOptions.stderr = ui.WrapStdio(term) + globalOptions.stdout, globalOptions.stderr = termstatus.WrapStdio(term) return term, func() { // shutdown termstatus diff --git a/internal/ui/stdio_wrapper.go b/internal/ui/termstatus/stdio_wrapper.go similarity index 86% rename from internal/ui/stdio_wrapper.go rename to internal/ui/termstatus/stdio_wrapper.go index f78533601..233610ba3 100644 --- a/internal/ui/stdio_wrapper.go +++ b/internal/ui/termstatus/stdio_wrapper.go @@ -1,15 +1,13 @@ -package ui +package termstatus import ( "bytes" "io" - - "github.com/restic/restic/internal/ui/termstatus" ) // WrapStdio returns line-buffering replacements for os.Stdout and os.Stderr. // On Close, the remaining bytes are written, followed by a line break. -func WrapStdio(term *termstatus.Terminal) (stdout, stderr io.WriteCloser) { +func WrapStdio(term *Terminal) (stdout, stderr io.WriteCloser) { return newLineWriter(term.Print), newLineWriter(term.Error) } diff --git a/internal/ui/stdio_wrapper_test.go b/internal/ui/termstatus/stdio_wrapper_test.go similarity index 98% rename from internal/ui/stdio_wrapper_test.go rename to internal/ui/termstatus/stdio_wrapper_test.go index b95d9180d..1e214f1f4 100644 --- a/internal/ui/stdio_wrapper_test.go +++ b/internal/ui/termstatus/stdio_wrapper_test.go @@ -1,4 +1,4 @@ -package ui +package termstatus import ( "strings"