Conditional structures: Difference between revisions
→{{header|Go}}: language change. braces required on else clauses.
No edit summary |
(→{{header|Go}}: language change. braces required on else clauses.) |
||
Line 1,101:
statements
}</lang>
<lang go>if booleanExpression1 {
statements
Line 1,112 ⟶ 1,108:
}
</lang>
If allows a statement to be included ahead of the condition. This is commonly a short variable declaration, as in,
<lang go>if x := fetchSomething(); if x > 0 {
|