A Tour of Go For is Go's "while"

At that point you can drop the semicolons(分号): C's while is spelled for in Go.

package main 

import "fmt"

func main() {
    sum := 1
    for sum < 1000 {
        sum += sum
    }
    fmt.Println(sum)
}
原文地址:https://www.cnblogs.com/ghgyj/p/4052970.html