Skip to content

Instantly share code, notes, and snippets.

Created December 22, 2012 07:12
Show Gist options
  • Select an option

  • Save anonymous/4357860 to your computer and use it in GitHub Desktop.

Select an option

Save anonymous/4357860 to your computer and use it in GitHub Desktop.

Revisions

  1. @invalid-email-address Anonymous created this gist Dec 22, 2012.
    35 changes: 35 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,35 @@
    googolplex /tmp % cat > test.go
    package main

    import "fmt"

    func main() {
    var num int
    for i := 0; i < 10; i++ {
    fmt.Printf("Debug: i : %d ", i)
    fmt.Scanf("%d", &num)
    fmt.Println(num)
    }
    }
    googolplex /tmp % go run test.go
    Debug: i : 0 1
    1
    Debug: i : 1 2
    2
    Debug: i : 2 3
    3
    Debug: i : 3 4
    4
    Debug: i : 4 5
    5
    Debug: i : 5 6
    6
    Debug: i : 6 7
    7
    Debug: i : 7 8
    8
    Debug: i : 8 9
    9
    Debug: i : 9 0
    0
    googolplex /tmp %