Created
November 18, 2017 00:34
-
-
Save gerep/447237c68c5a12cd7654f4fdb8d75720 to your computer and use it in GitHub Desktop.
Loading animation for terminal
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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