work while traveling
package main
import (
"fmt"
"time"
)
func main() {
destinations := []string{"New York", "Paris", "Tokyo", "London", "Sydney"}
for _, destination := range destinations {
fmt.Printf("Traveling to %s...\n", destination)
visit(destination)
}
}
func visit(destination string) {
fmt.Printf("Arrived at %s\n", destination)
time.Sleep(2 * time.Second)
fmt.Printf("Exploring %s...\n", destination)
time.Sleep(3 * time.Second)
fmt.Printf("Finished exploring %s\n", destination)
}