-
Notifications
You must be signed in to change notification settings - Fork 38
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
move init() from the shared package into the CLI #4
Comments
I should add that another approach is to modify this package to use it's own rand.Rand object instead of the global one. |
+1, that's a fine approach. Just go ahead and move the seed to the main.go. That's definitely where it belongs. Thanks! |
Cool. PR at #5. |
Great, thanks. I've merged it and pushed trunk. I'll release 2.7 very
soon.
Cheers!
Dustin
:-Dustin
@dustinkirkland
…On Fri, Apr 7, 2017 at 3:25 PM, Brian Fallik ***@***.***> wrote:
Cool. PR at #5 <#5>.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#4 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAzMhkRqM7f_sxVG5cubLdu7WUIIrz7Wks5rtpu8gaJpZM4MzZ3E>
.
|
How is this versioned for users of the package? This is a breaking change to API of the petname Go package. The "blessed" Go way is to never change the API, but the more pragmatic approach is to version with semver and tag releases in Github. That way tools like glide can pick up the versions. |
Hi,
We'd like to use your library to generate nonces but I'm concerned about the init() function that's included in petname.go. This init() will be called on startup and could conflict with other calls to rand.Seed().
In our case we have some code to alternate between a specific seed in order to repeat a test run and time.Now().UTC().UnixNano() for psuedo-random behavior.
Would you be open to simple PR to move the init() into https://github.com/dustinkirkland/golang-petname/blob/master/cmd/petname/main.go? This shouldn't affect the behavior of the petname utility but it will make it easier for us to reuse the library.
Thanks,
brian
The text was updated successfully, but these errors were encountered: