Gospinner lets you make simple spinners for your go cli applications. Is fast and easy to use. Simple customizations and ready to go defaults!
go get github.com/slok/gospinner
s, _ := gospinner.NewSpinner(gospinner.Dots)
s.Start("Loading")
// Do stuff
s.Finish()
s, _ := gospinner.NewSpinnerWithColor(gospinner.Ball, gospinner.FgGreen)
s.Start("Loading")
// Do stuff
s.Finish()
s, _ := s, _ := gospinner.NewSpinnerNoColor(gospinner.GrowHorizontal)
s.Start("Loading")
// Do stuff
s.Finish()
s, _ := gospinner.NewSpinner(gospinner.Pong)
s.Start("Loading job 1")
// Do job 1 ...
s.Succeed()
s.Start("Loading job 2")
// Do job 2 ...
s.Fail()
s.Start("Loading job 3")
// Do job 3 ...
s.Warn()
s, _ := gospinner.NewSpinner(gospinner.Square)
s.Start("Loading")
// Do stuff
s.SetMessage("Starting server dependencies")
// Do more stuff
s.SetMessage("Starting server")
// Do more stuff
s.FinishWithMessage("⚔", "Finished!")
For more customizations you should check the documentation
The MIT License (MIT) - see LICENSE.md
for more details