Skip to content

Instantly share code, notes, and snippets.

@hibooboo2
Created September 15, 2017 03:42
Show Gist options
  • Save hibooboo2/ddaa12831cca9dd38de59c47a20555b0 to your computer and use it in GitHub Desktop.
Save hibooboo2/ddaa12831cca9dd38de59c47a20555b0 to your computer and use it in GitHub Desktop.
A spinner for go, using clock emoji.
package main
import (
"time"
"github.com/janeczku/go-spinner"
)
func main() {
s := spinner.StartNew("This may take some while...")
s.SetCharset([]string{
"πŸ•›",
"πŸ•§",
"πŸ•",
"πŸ•œ",
"πŸ•‘",
"πŸ•",
"πŸ•’",
"πŸ•ž",
"πŸ•“",
"πŸ•Ÿ",
"πŸ•”",
"πŸ• ",
"πŸ••",
"πŸ•‘",
"πŸ•–",
"πŸ•’",
"πŸ•—",
"πŸ•£",
"πŸ•˜",
"πŸ•€",
"πŸ•™",
"πŸ•₯",
"πŸ•š",
"πŸ•¦",
})
// s.SetCharset([]string{".", ".", "\\", "/", "|", "*"})
s.SetSpeed(time.Millisecond * 200) // something more productive here
time.Sleep(6 * time.Second)
s.Stop()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment