You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First of all, thans for your great cron job.
I read dayMatches code in spec.go but did not figure out why you check starBit before return result.
Why use || operation when both starBit of dom and dow is 0. I think we always need use && to get result.
Could youhelp to explain some details of this?
Thanks in advance :)
// dayMatches returns true if the schedule's day-of-week and day-of-month// restrictions are satisfied by the given time.funcdayMatches(s*SpecSchedule, t time.Time) bool {
var (
domMatchbool=1<<uint(t.Day())&s.Dom>0dowMatchbool=1<<uint(t.Weekday())&s.Dow>0
)
ifs.Dom&starBit>0||s.Dow&starBit>0 {
returndomMatch&&dowMatch
}
returndomMatch||dowMatch
}
The text was updated successfully, but these errors were encountered:
rickywei
changed the title
what isthe starbit used for?
what is the starbit used for?
Nov 25, 2022
First of all, thans for your great cron job.
I read dayMatches code in spec.go but did not figure out why you check starBit before return result.
Why use || operation when both starBit of dom and dow is 0. I think we always need use && to get result.
Could youhelp to explain some details of this?
Thanks in advance :)
The text was updated successfully, but these errors were encountered: