ui: Simplify stdio wrapper

The StdioWrapper type is really just a pair of io.WriteClosers, so
remove it in favor of a function that returns two of those. Test
coverage increases because the removed code was not tested.
This commit is contained in:
greatroar
2024-05-21 11:23:32 +02:00
parent 7f439a9c34
commit 0b56214473
2 changed files with 5 additions and 29 deletions
+1 -2
View File
@@ -31,8 +31,7 @@ func setupTermstatus() (*termstatus.Terminal, func()) {
// use the termstatus for stdout/stderr
prevStdout, prevStderr := globalOptions.stdout, globalOptions.stderr
stdioWrapper := ui.NewStdioWrapper(term)
globalOptions.stdout, globalOptions.stderr = stdioWrapper.Stdout(), stdioWrapper.Stderr()
globalOptions.stdout, globalOptions.stderr = ui.WrapStdio(term)
return term, func() {
// shutdown termstatus