Go borrows several of its control flow syntax from the C-family of languages. It supports all of the expected control structures, including
for loop, and even
goto. Conspicuously absent, though, are
do...while statements. The following topics in this chapter examine Go's control flow elements, some of which you may already be familiar with, and others that bring a new set of functionalities not found in other languages:
if statement, in Go, borrows its basic structural form from other C-like languages. The statement conditionally executes a code block when the Boolean expression that follows the
if keyword ...