You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Tests are seeding the global random number generator. However, seeding the global random number generator is not recommended since its global state can be changed by other packages at runtime.
Suggested Solution
Avoid using the global random number generator for tests, especially if randomized tests print out their nondeterministic seed to allow reproducing test failures.
Use rand.New to create, seed, and use non-global (private) random number generators. This will allow control over determinism vs non-determinism.
The text was updated successfully, but these errors were encountered:
Issue To Be Solved
Tests are seeding the global random number generator. However, seeding the global random number generator is not recommended since its global state can be changed by other packages at runtime.
Suggested Solution
Avoid using the global random number generator for tests, especially if randomized tests print out their nondeterministic seed to allow reproducing test failures.
Use
rand.New
to create, seed, and use non-global (private) random number generators. This will allow control over determinism vs non-determinism.The text was updated successfully, but these errors were encountered: