-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change randomness behaviour to be like it prior to go1.20
Pre go1.20, rand.Seed needed to be called for randomness. Meaning, that math/rand delivered deterministic values by default. This was changed however. To restore the old behaviour, we need to manually seed our random generator with a constant. Additionally, this introduce a local instance of rand.Rand, in order to prevent unexpected behaviour with other code that relies on the global math/rand package. Fixes #10 (The readme and docs explain this, therefore I consider this solved, as it is by design and not a bug) Fixes #15
- Loading branch information
1 parent
e794b93
commit 64ecdb6
Showing
3 changed files
with
28 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters