This commit is contained in:
Mark McGranaghan 2012-09-20 20:32:58 -07:00
parent 67c7a30b0f
commit f94d7463aa

View File

@ -1,8 +1,5 @@
// `for` is Go's only looping construct. Below are two common
// forms.
package main
package main // `for` is Go's only looping construct. Below are
// two common forms.
import "fmt"
func main() {
@ -12,9 +9,9 @@ func main() {
i = i + 1
}
for j := 1; j <= 10; j++ { // This is a common idiom. We can do it on one line.
fmt.Println(j)
}
for j := 1; j <= 10; j++ { // That type of loop is common. We can do it on one
fmt.Println(j) // line.
}
} // There are other forms of `for`; we'll see them
// later.
// There are other forms of `for`; we'll see them later.