Thoughts on using spinner for HTTP download progress indicator?
#165
Unanswered
andyfeller
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Question
How might someone already using
briandowns/spinnerincorporate it in HTTP downloads where thePrefix/Suffixneeded to be dynamic?Thoughts
During the course of cli/cli#8536, someone brought up https://github.com/schollz/progressbar for displaying a progress indicator around HTTP downloads. Apparently, it works through the use of
io.MultiWriterto provide the IO stream, which is configured with information on the total number of bytes.I thought this might be in
briandowns/spinnerwheelhouse and potentially doable through thePreUpdate func(s *Spinner)hook:spinner/spinner.go
Lines 349 to 363 in 5543086
Maybe the caller constructs an anonymous function that involves a similar
io.MultiWriterwith the content size to generate an updatedPrefix?Thanks
❤️ Finally, I just want to thank you on behalf of the GitHub CLI as your project has helped our users for several years now, @briandowns! 🙇
Beta Was this translation helpful? Give feedback.
All reactions