while-like for loop
- while
package main
import (
"fmt"
)
func main() {
i := 0
for i < 5 {
fmt.Println(i)
i++
}
}
0
1
2
3
4
Press ← or → to navigate between chapters
Press S or / to search in the book
Press ? to show this help
Press Esc to hide this help
package main
import (
"fmt"
)
func main() {
i := 0
for i < 5 {
fmt.Println(i)
i++
}
}
0
1
2
3
4