Golang condition-only for - Golang Condition-Only for Statement
The Condition-Only for Statement
Go allows you to leave off both the initialization and the increment in a for statement. That leaves a for statement that functions like the while statement found in C, Java, JavaScript, Python, Ruby, and many other languages. It looks like Example 4-9.
Example 4-9. A condition-only for statement
i := 1 for i < 100 { fmt.Println(i) i = i * 2 }