Loops
The for
loop is the only loop available in Go.
for initialization; condition; post {
// code to execute
}
for condition {
// "while" loop
}
for {
// infinite loop
}
for index, value := range elements {
// foreach loop
}
for i := range integer {
// "repeat" loop
}