Skip to content
/ spingo Public

SpinGO is a very basic library for making progress spinners.

License

Notifications You must be signed in to change notification settings

talwat/spingo

Repository files navigation

SpinGO

GitHub Action GitHub license Go Report Card GoDoc

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.

Table of contents

Demo

Note: Framerate are not fully accurate. Here is another, more accurate demo using asciinema.

Installation

go get -u github.com/talwat/spingo

Usage

spinner := spingo.Spinner{}

for i := 0; i < 100; i++ {
    spinner.DisplaySpinner()
    time.Sleep(40 * time.Millisecond)
}

spinner.End()

Customization

These are fields in the Spinner struct.

Prefix

Prefix to display before the spinner.

Suffix

Suffix to display after the spinner.

SpinnerArt

Spinner art to display, eg. ["/", "|", "\\", "-"]