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

Allow to use a seeded random for word generation #12

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

dhontecillas
Copy link

In some cases is useful to have a deterministic / reproducible sequence of random generated words, and with this PR we add a new constructor function: NewBabblerWithRand , so we can provide an initialized random generator, to generate the words.

Also, since the non-global random generator in go is not thread-safe, a Mutex (a write one because the random objects gets updated when we request a number) is added to the call that returns a a string.

With this PR we do not break any existing API contract or functionality, and existing apps can keep having previous non deterministic.

dhontecillas and others added 4 commits March 24, 2023 19:37
Bumps [golang.org/x/net](https://github.com/golang/net) from 0.8.0 to 0.33.0.
- [Commits](golang/net@v0.8.0...v0.33.0)

---
updated-dependencies:
- dependency-name: golang.org/x/net
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>
…/net-0.33.0

Bump golang.org/x/net from 0.8.0 to 0.33.0
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.

2 participants