gospinner
Table Of Contents
Intro
Go library for animation in the terminal.
License
The gospinner is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License Version 3.
Learn
Module
For more information about the module, use the link.
Use
Run live ellipsis three iterations:
gospinner.Spinner{
Frame: func(s gospinner.Spinner) {
fmt.Print(goescape.Cursor().Save + goescape.Cursor().Hide)
for i := 0; i < 3; i++ {
for n := 0; n < 3; n++ {
time.Sleep(time.Second)
fmt.Print(s.Gens[0][0]())
}
time.Sleep(time.Second)
fmt.Print(goescape.Cursor().Restore + " " + goescape.Cursor().Restore)
}
},
Gens: [][]func(data ...interface{}) string {
[]func(...interface{}) string{
func(data ...interface{}) string {
return "."
},
},
},
Defer: func() {
fmt.Print(goescape.Cursor().Show)
},
}.Start()
Start
Get
To get, execute the command:
~ $ go get -v notabug.org/_percival/gospinner@latest
Update
To update, execute the command:
~ $ go get -u -v notabug.org/_percival/gospinner@latest