Closed
Description
Describe the bug
List of params passed to Do method must correspond to function, otherwise job isn't executed silently
To Reproduce
The following test reproduces the bug
``
func Test_SpecificTime_WithIncorrectParams(t *testing.T) {
quit := make(chan bool)
action := func(s1, s2 string) {
fmt.Printf("fired: %s, %s", s1, s2)
quit <- true
}
s := gocron.NewScheduler(time.UTC)
s.StartAsync()
j, err := s.Every(1).Day().StartAt(time.Now().UTC().Add(time.Second * 10)).Do(action, "s1")
if err != nil {
t.Fatal()
}
fmt.Println("next run = ", j.NextRun())
select {
case <-time.After(time.Second * 20):
fmt.Println("time out")
t.Fatal()
case <-quit:
fmt.Println("passed")
}
}
``
Version
1.0.0
Expected behavior
I suggest to return a n error from Do func if the list of passed params is wrong.
I could prepare a PR if you aren't against