In this lecture, you will go through algorithmic “patterns” for loops in Go: a sum accumulator, conditional counting, finding a maximum with correct initialization, searching with a
found flag and the
break statement, as well as combining multiple computations in a single pass. At the end, we will discuss typical mistakes (loop boundaries, empty input, incorrect initialization) and how to write more reliable code.