concept loop in category go

appears as: loops, loop, loop, The loop
Get Programming with Go

This is an excerpt from Manning's book Get Programming with Go.

  • Repeat code with for loops
  • Before each iteration, the expression count > 0 is evaluated to produce a Boolean value. If the value is false (count = 0), the loop terminates—otherwise, it runs the body of the loop (the code between { and }).

    Listing 4.3. Short declaration in a for loop: short-loop.go
    for count := 10; count > 0; count-- {
        fmt.Println(count)
    }                      #1