Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] - panic: runtime error: integer divide by zero #294

Closed
xwjdsh opened this issue Feb 16, 2022 · 0 comments · Fixed by #295
Closed

[BUG] - panic: runtime error: integer divide by zero #294

xwjdsh opened this issue Feb 16, 2022 · 0 comments · Fixed by #295
Labels
bug Something isn't working

Comments

@xwjdsh
Copy link

xwjdsh commented Feb 16, 2022

Same as #282, another case.

package main

import (
	"time"

	"github.com/go-co-op/gocron"
)

func main() {
	s := gocron.NewScheduler(time.UTC)
	t := time.Date(2022, 1, 24, 0, 0, 0, 0, time.UTC)

	s.Every(1).Months(25).StartAt(t).Do(func() {})
	s.StartBlocking()
}
% go run -trimpath main.go
panic: runtime error: integer divide by zero

goroutine 1 [running]:
github.com/go-co-op/gocron.(*Scheduler).scheduleNextRun(0xc000110000, 0xc000112180)
        github.com/go-co-op/gocron@v1.12.1-0.20220214155418-2d070e5db0fe/scheduler.go:178 +0x572
github.com/go-co-op/gocron.(*Scheduler).Do(0xc000110000, {0x10bb860, 0x10daf88}, {0x0, 0x0, 0x0})
        github.com/go-co-op/gocron@v1.12.1-0.20220214155418-2d070e5db0fe/scheduler.go:806 +0x445
main.main()
        ./main.go:15 +0x265
exit status 2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant