Go language Programming (vii) Process Control

Source: Internet
Author: User
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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.