January 1, 0001

Flow Control

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