Skip to content

Instantly share code, notes, and snippets.

Created December 22, 2012 07:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/4357860 to your computer and use it in GitHub Desktop.
Save anonymous/4357860 to your computer and use it in GitHub Desktop.
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 %
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment