control

If you end with a complete statement, lexer puts ; so {/else must be on same line

If

if x < 0 && err == nil{
    result = "Greater"
} else if x == 0 {
    result = "Equal"
} else {
    result = "Less"
}

Scoping

Can scope to conditonal block

if x := 42; x < 0 {
    //....
}
fmt.Println(x) //WONT WORK

Switch

Like C/Java, but evaluates any simple type and no breaks needed jumps after block fround

Can do if like stuff

For

Basic

Over a collections

While

GO-TO!!!

with labels and jumps

Last updated