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

Fix examples in README #12

Merged
merged 1 commit into from
Mar 7, 2023
Merged

Fix examples in README #12

merged 1 commit into from
Mar 7, 2023

Conversation

fr3fou
Copy link
Contributor

@fr3fou fr3fou commented Mar 6, 2023

Description

The examples in the README had some issues, which prevented the example code to compile, for example:

id, err := scheduler.Add(&tasks.Task{
  Interval: time.Duration(30 * time.Second), // <- the explicit cast to time.Duration is redundant
  Interval: 30 * time.Second,
  TaskFunc: func() error {
    // Put your logic here
  }(), // <- the () are not needed
  },
})

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update
  • Small and simple changes (Tech Debt, Doc updates, Adding tests, etc.)

Checklist:

  • I have performed a self-review of my own code
  • I have commented my code, ensuring GoDoc readability and clarity in hard-to-understand areas
  • I have made corresponding changes to documentation
  • I have added tests that ensure my fix is effective or that my feature works
  • Any dependent changes have been merged and published in downstream modules

If checklist items are unchecked please explain.

@madflojo
Copy link
Owner

madflojo commented Mar 6, 2023

Awesome thanks!

@madflojo madflojo merged commit 8b7bb74 into madflojo:main Mar 7, 2023
@fr3fou fr3fou deleted the patch-1 branch April 15, 2024 18:24
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.

None yet

2 participants