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

hooks/test: fix incorrect use of math/rand #1426

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

dolmen
Copy link
Contributor

@dolmen dolmen commented Mar 12, 2024

Fix incorrect uses of math/rand:

Fix incorrect uses of math/rand:
- do not call rand.Seed() in a test as it affects the global pseudo-random number
  generator and might affect other tests (or Logrus itself). Instead, use a local
  instance of a number generator
- seed with time.Now().UnixNano() instead of time.Now().Unix() for more
  randomness
- use "rand.Intn(100)" instead of "rand.Int() % 100"
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.

1 participant