SpinGO is a very basic library for making progress spinners which has no dependencies.
SpinGO is single threaded and meant to be used as a progress indicator, there are other good libraries if you want the spinner to display no matter what's going on.
Note: Framerate are not fully accurate. Here is another, more accurate demo using asciinema.
go get -u github.com/talwat/spingo
spinner := spingo.Spinner{}
for i := 0; i < 100; i++ {
spinner.DisplaySpinner()
time.Sleep(40 * time.Millisecond)
}
spinner.End()
These are fields in the Spinner
struct.
Prefix to display before the spinner.
Suffix to display after the spinner.
Spinner art to display,
eg. ["/", "|", "\\", "-"]