You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A Golang command line tool to show a spinner as you wait for some long running jobs to finish.
This is a simple project but carries a tremendous value to me [❤️].
Usage
Install chin:
go get -u github.com/adhocore/chin
Use in Go code with WaitGroup:
varwg sync.WaitGroups:=chin.New().WithWait(&wg)
gos.Start()
// invoke some long running task// (you can also call s.Stop() from that task)longTask(&wg)
s.Stop()
wg.Wait()
Refer and run working examples with: go run examples/main.go
Custom Spinner
You can choose from provided spinner sets chin.Default, chin.Arrows and chin.Dots:
chin.Default is selected by default so you don't have to specify it.
You can also define your own spinner set with delay and animation chars like so:
// Animates 0 to 4 in a gap of 50ms:s:=chin.New(chin.Set{50*time.Millisecond, []string{"0", "1", "2", "3", "4", "3", "2", "1"}})
gos.Start()
Screen
Other projects
My other golang projects you might find interesting and useful:
gronx - Lightweight, fast and dependency-free Cron expression parser (due checker), task scheduler and/or daemon for Golang (tested on v1.13 and above) and standalone usage.
urlsh - URL shortener and bookmarker service with UI, API, Cache, Hits Counter and forwarder using postgres and redis in backend, bulma in frontend; has web and cli client.
fast - Check your internet speed with ease and comfort right from the terminal. (It uses adhocore/chin.)
goic - Go Open ID Connect, is OpenID connect client library for Golang, supports the Authorization Code Flow of OpenID Connect specification.