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

provide ant way to change the value of Now for testing purposes #496

Open
aaron-sysdig opened this issue Jul 6, 2023 · 1 comment
Open

Comments

@aaron-sysdig
Copy link

in order to test code which uses this library it would be very helpful if this library did not directly call time.Now() but instead allowed the user to specify how this library determines when Now is

@jiangzhongqiang
Copy link

in order to test code which uses this library it would be very helpful if this library did not directly call time.Now() but instead allowed the user to specify how this library determines when Now is

This is my optimized version that can meet your needs( https://github.com/jiangzhongqiang/cron/
I added a new option Clock
usage: cron.New(cron.WithClock(xxx))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants