GO Condition
if day == "sunday" || day == "saturday" {
rest()
} else if day == "monday" && isTired() {
groan()
} else {
work()
}
if _, err := doThing(); err != nil {
fmt.Println("Uh oh")
GO Switch
switch day {
case "sunday":
// cases don't "fall through" by default!
fallthrough
case "saturday":
rest()
default:
work()
}
GO Loop
for count := 0; count <= 10; count++ {
fmt.Println("My counter is at", count)
}
entry := []string{"Misaki","Taro","Hanako"}
for i, val := range entry {
fmt.Printf("At position %d, the character %s is present\n", i, val)
n := 0
x := 42
for n != x {
n := guess()
}