forked from TrueCloudLab/restic
Merge pull request #3242 from greatroar/fprintln
internal/ui/termstatus: Use Fprintln to get a newline
This commit is contained in:
commit
43cb26010a
1 changed files with 2 additions and 3 deletions
|
@ -210,9 +210,8 @@ func (t *Terminal) runWithoutStatus(ctx context.Context) {
|
||||||
|
|
||||||
case stat := <-t.status:
|
case stat := <-t.status:
|
||||||
for _, line := range stat.lines {
|
for _, line := range stat.lines {
|
||||||
// ensure that each line ends with newline
|
// Ensure that each message ends with exactly one newline.
|
||||||
withNewline := strings.TrimRight(line, "\n") + "\n"
|
fmt.Fprintln(t.wr, strings.TrimRight(line, "\n"))
|
||||||
fmt.Fprint(t.wr, withNewline)
|
|
||||||
}
|
}
|
||||||
if err := t.wr.Flush(); err != nil {
|
if err := t.wr.Flush(); err != nil {
|
||||||
fmt.Fprintf(os.Stderr, "flush failed: %v\n", err)
|
fmt.Fprintf(os.Stderr, "flush failed: %v\n", err)
|
||||||
|
|
Loading…
Reference in a new issue