Created
March 13, 2019 14:01
-
-
Save inkychris/aa7713f6f5b0fae4f7a9e780e8aa9bf1 to your computer and use it in GitHub Desktop.
A test program for printing slowly to STDOUT
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
package main | |
import ( | |
"fmt" | |
"os" | |
"strconv" | |
"time" | |
) | |
func main() { | |
var n int | |
if len(os.Args) == 2 { | |
n, _ = strconv.Atoi(os.Args[1]) | |
} | |
if n == 0 { | |
n = 3 | |
} | |
for i := 1; i <= n; i++ { | |
fmt.Println(i) | |
time.Sleep(time.Second) | |
} | |
fmt.Println("DONE") | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment