// Chapter 35 example: weekdays, and a loop over the days of a week. // Run with: go run exercises/35/07-weekdays.go package main import ( "fmt" "time" ) func isWeekend(t time.Time) bool { day := t.Weekday() return day == time.Saturday || day == time.Sunday } func main() { day := time.Date(2025, time.August, 13, 0, 0, 0, 0, time.UTC) for range 7 { label := "work day" if isWeekend(day) { label = "weekend" } fmt.Printf("%s %-9s %s\n", day.Format("2006-01-02"), day.Weekday(), label) day = day.AddDate(0, 0, 1) } }