Go Decision Making
# Go Conditional Statements
Conditional statements require the developer to specify one or more conditions and decide whether to execute specified statements by testing whether the conditions are true. If the condition is false, other statements are executed.
The following diagram illustrates the structure of conditional statements in programming languages:

Go provides the following conditional judgment statements:
| Statement | Description |
| --- | --- |
| (#) | An **if statement** consists of a boolean expression followed by one or more statements. |
| [if...else Statement](#) | An **if statement** can be followed by an optional **else statement**, which executes when the boolean expression is false. |
| (#) | You can nest one or more **if** or **else if** statements within an **if** or **else if** statement. |
| (#) | A **switch statement** is used to execute different actions based on different conditions. |
| (#) | A **select statement** is similar to a **switch statement**, but select will randomly execute one runnable case. If no case is runnable, it will block until a case becomes runnable. |
> Note: Go does not have a ternary operator, so it does not support conditional judgment in the form of **?:**.
YouTip