IF
if day == "monday" {
fmt.Println("monday")
} else if day == "sunday" || day == "saturday" {
fmt.Println("weekend")
} else {
// otherwise
}
Switch
switch num {
case 1:
// don't "fall through" by default!
fallthrough
case 2:
rest()
default:
work()
}
For-Range
arrName := []string{"tom","jack","bob"}
for i, val := range arrName {
fmt.Printf("idx %d, value: %s \n", i, val)
}
For
for count := 0; count <= 10; count++ {
fmt.Println("couter:", count)
}