INNER CODE UNIT · Go
isWeekday
asobti/kube-monkey · internal/pkg/calendar/calendar.go:15
func isWeekday(t time.Time) bool {
switch t.Weekday() {
case time.Monday, time.Tuesday, time.Wednesday, time.Thursday, time.Friday:
return true
case time.Saturday, time.Sunday:
return false
}
glog.Fatalf("Unrecognized day of the week: %s", t.Weekday().String())
panic("Explicit Panic to avoid compiler error: missing return at end of function")
}
// Returns the next weekday in Location
func nextWeekday(loc *time.Location) time.Time {
check := time.Now().In(loc)
for {
check = check.AddDate(0, 0, 1)