Skip to content

Commit 32d82c6

Browse files
authored
progressbar: Print to os.Stdout (#80)
1 parent dd16e6e commit 32d82c6

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

progressbar/progressbar.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -121,10 +121,10 @@ func (pb *ProgressBar) print(f format) {
121121

122122
width := buf.Len()
123123
if width < pb.lastWidth {
124-
io.WriteString(os.Stderr,
124+
io.WriteString(os.Stdout,
125125
fmt.Sprintf("\r%s\r%s", strings.Repeat(" ", pb.lastWidth), buf.Bytes()))
126126
} else {
127-
io.WriteString(os.Stderr, "\r\r"+buf.String())
127+
io.WriteString(os.Stdout, "\r\r"+buf.String())
128128
}
129129

130130
pb.lastWidth = width
@@ -236,13 +236,13 @@ func (pb *ProgressBar) startCount() {
236236
f.Left = "Complete"
237237

238238
pb.print(f)
239-
io.WriteString(os.Stderr, "\n")
239+
io.WriteString(os.Stdout, "\n")
240240

241241
close(pb.done)
242242
return
243243
}
244244
case <-pb.ctx.Done():
245-
io.WriteString(os.Stderr, "\nCancelled\n")
245+
io.WriteString(os.Stdout, "\nCancelled\n")
246246
return
247247
}
248248
}

0 commit comments

Comments
 (0)