don't trash the incoming slice, match what was done in NewAtTime (#724)

This commit is contained in:
Scot Bontrager 2024-05-01 22:30:07 -05:00 committed by GitHub
parent 5f14dac979
commit 917cca7f5c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 1 deletions

3
job.go
View File

@ -291,7 +291,8 @@ type Weekdays func() []time.Weekday
// NewWeekdays provide the days of the week the job should run.
func NewWeekdays(weekday time.Weekday, weekdays ...time.Weekday) Weekdays {
return func() []time.Weekday {
return append(weekdays, weekday)
weekdays = append(weekdays, weekday)
return weekdays
}
}