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

panic when duration is 0 #12

Merged
merged 2 commits into from
Aug 11, 2017
Merged

panic when duration is 0 #12

merged 2 commits into from
Aug 11, 2017

Conversation

malisetti
Copy link
Contributor

fixes #11

@@ -50,11 +50,12 @@ func main() {
d := parseDuration(args["--tick"].(string))
max := parseInt(args["--max"].(string))
tmpl := readAll(os.Stdin)
tick := time.Tick(d)
ticker := time.NewTicker(d)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wouldn't this panic if i pass in --tick 0, IIRC NewTicker() expects d > 0.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

doh, i misread the goal of this PR

@yields
Copy link
Owner

yields commented Aug 11, 2017

thanks! -- just the one comment 👌

@yields yields merged commit 0ac60b9 into yields:master Aug 11, 2017
@yields
Copy link
Owner

yields commented Aug 11, 2017

thanks!

@malisetti malisetti deleted the patch-1 branch August 13, 2017 04:47
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

Successfully merging this pull request may close these issues.

tick of 0s causes deadlock
2 participants