Skip to content

Instantly share code, notes, and snippets.

@gerep
Created Nov 18, 2017
Embed
What would you like to do?
Loading animation for terminal
func spinner(delay time.Duration) {
for {
for _, r := range `-\|/` {
fmt.Printf("\r%c", r)
time.Sleep(delay)
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment