Display multiple progress bars in Go (golang).
Display progress bars in Go
$ go run main.go
here we have a progress bar
some work 30% [====================>-------------------------------------------] 925ms
and here we have another progress bar
here we have a longer prepend string 25% [==========>--------------------------] 911ms
working... 19% [=============>-------------------------------------------------] 911msWhen you call .MakeBar(total int, prepend string), the returned progress bar
has options that you can change to fit your needs. Here are the defaults:
- Width: screen width - len(prepend) - 20
- Total: total (passed in)
- Prepend: prepend (passed in)
- LeftEnd: '['
- RightEnd: ']'
- Fill: '='
- Head: '>'
- Empty: '-'
- ShowPercent: true
- ShowTimeElapsed: true(note, in the example gif, we are manually resetting the terminal mode. We NO LONGER have to, issue fixed)
You can run this with cd demo; go run main.go.
…When you run tests, a lot of terminal cursor movement happens. This will cause the output to look all kinds of messed up.
In most unix systems, clear or cmd+k should clear out the output.
See LICENSE.md
No open issues yet, or sync has not completed.