ensure progress downloader is well formated

This commit is contained in:
Victor Vieux
2013-05-30 17:00:42 +00:00
8 changed files with 108 additions and 82 deletions
+1 -1
View File
@@ -105,7 +105,7 @@ func (r *progressReader) Close() error {
func ProgressReader(r io.ReadCloser, size int, output io.Writer, template []byte, sf *StreamFormatter) *progressReader {
tpl := string(template)
if tpl == "" {
tpl = "%v/%v (%v)"
tpl = string(sf.FormatProgress("", "%v/%v (%v)"))
}
return &progressReader{r, NewWriteFlusher(output), size, 0, 0, tpl, sf}
}