...

/

The for range Construct

The for range Construct

This lesson discusses another variation for running loops in Go, i.e., the for range construct

We'll cover the following...

Infinite loop

The condition can be absent like in:

for i:=0; ; i++ or for { }

This is the same as for ;; { } but the ; ; is removed by gofmt. These are infinite loops. The latter could also be written as:

for true { }

But the normal format is:

for { }
...