code: func getIoProgressReader(label string, res *http.Response) io.Reader {
  	prefix := "Downloading " + label
  	fmtBytesSize := 18
  	barSize := int64(80 - len(prefix) - fmtBytesSize)
  	bar := ioprogress.DrawTextFormatBarForW(barSize, os.Stderr)
  	fmtfunc := func(progress, total int64) string {
  		// Content-Length is set to -1 when unknown.
  		if total == -1 {
  			return fmt.Sprintf(
  				"%s: %v of an unknown total size",
  				prefix,
  				ioprogress.ByteUnitStr(progress),
  			)
  		}
  		return fmt.Sprintf(
  			"%s: %s %s",
  			prefix,
  			bar(progress, total),
  			ioprogress.DrawTextFormatBytes(progress, total),
  		)
  	}
  	return &ioprogress.Reader{
  		Reader:       res.Body,
  		Size:         res.ContentLength,
  		DrawFunc:     ioprogress.DrawTerminalf(os.Stderr, fmtfunc),
  		DrawInterval: time.Second,
  	}
  }
docs: // getIoProgressReader returns a reader that wraps the HTTP response
  // body, so it prints a pretty progress bar when reading data from it.