Count To Ten
package main import "fmt" /* * Count to ten in go. */ func main() { const limit = 10 for i := 1; i <= limit; i++ { fmt.Printf("%d ", i) } fmt.Printf("GO!\n") }
This program simply prints the numbers from 1 to 10. Some notable things:

Go allows the increment i++, but in Go it is classified as a statement, not an expression. This eliminates some of the more painful things allowed in C (and sometimes Java). There is no ++i.