This is a creation in Article, where the information may have evolved or changed.
The process control statements of programming language are used to set the order of calculation execution and to establish the logical structure of the program. It can be said that the Process Control statement is the skeleton of the entire program.
Fundamentally, the process control is only for the control of the order of execution of the statement, generally need to cooperate with a variety of conditions, therefore, in various processes, will be added conditional judgment statement. A Process Control statement generally has the following 3 functions:
selection , i.e. jump to a different execution sequence according to the conditions;
Loop , which executes a sequence repeatedly according to the conditions, of course, the input and output of each loop execution may change;
jumps , which are returned to an execution sequence based on the condition.
The go language supports several flow control statements such as the following:
conditional Statements , the corresponding keywords are if, else and else if;
Select the statement , the corresponding keywords are switch, case and select;
loop statements , corresponding keywords for and range;
Jump Statement , the corresponding keyword is goto.
The go language also adds the following keywords: break, continue, and Fallthrough