Skip to content

Instantly share code, notes, and snippets.

@inkychris
Created March 13, 2019 14:01
Show Gist options
  • Save inkychris/aa7713f6f5b0fae4f7a9e780e8aa9bf1 to your computer and use it in GitHub Desktop.
Save inkychris/aa7713f6f5b0fae4f7a9e780e8aa9bf1 to your computer and use it in GitHub Desktop.
A test program for printing slowly to STDOUT
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