(t time.Time, field cronField)
| 325 | } |
| 326 | |
| 327 | func getTimeValue(t time.Time, field cronField) int { |
| 328 | |
| 329 | switch field { |
| 330 | case cronFieldNanoSecond: |
| 331 | return t.Nanosecond() |
| 332 | case cronFieldSecond: |
| 333 | return t.Second() |
| 334 | case cronFieldMinute: |
| 335 | return t.Minute() |
| 336 | case cronFieldHour: |
| 337 | return t.Hour() |
| 338 | case cronFieldDayOfMonth: |
| 339 | return t.Day() |
| 340 | case cronFieldMonth: |
| 341 | return int(t.Month()) |
| 342 | case cronFieldDayOfWeek: |
| 343 | if t.Weekday() == 0 { |
| 344 | return 7 |
| 345 | } |
| 346 | return int(t.Weekday()) |
| 347 | } |
| 348 | |
| 349 | panic("unreachable code!") |
| 350 | } |
| 351 | |
| 352 | func addTime(t time.Time, field cronField, value int) time.Time { |
| 353 | switch field { |
no outgoing calls
no test coverage detected