This is how implemented function find alternate saturdays. It finds the first saturday date, then compares the input date with 2nd and 4th saturdays.
func isAlternateSaturday(date time.Time) bool {
firstDateOfMonth := time.Date(date.Year(), date.Month(), 1, 0, 0, 0, 0, nil)
firstSaturday := (6-int(firstDateOfMonth.Weekday())) + firstDateOfMonth.Day()
return (date.Day() == firstSaturday + 7) || (date.Day() == firstSaturday + 21)
}
Then integrated it with main IsHoliday function:
func IsHoliday(date time.Time) bool {
return date.Weekday() == time.Sunday || isAlternateSaturday(date)
}