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

proposal: add uuid generator to stdlib #23789

Closed
timakin opened this issue Feb 12, 2018 · 12 comments

Comments

@timakin
Copy link
Contributor

commented Feb 12, 2018

Currently we generate uuid/guid with external packages or original implementations using crypto/rand etc...
And in some cases you use other languages' library...
As I argued on golang-nuts, I propose to implement the generator as a standard package.
https://groups.google.com/forum/#!topic/golang-nuts/J_htXsnVjdY

RFC4122 defines the specification of UUID representation.
And at first, how's to support uuid v4 package to create random ids?

@gopherbot gopherbot added this to the Proposal milestone Feb 12, 2018

@gopherbot gopherbot added the Proposal label Feb 12, 2018

@rasky

This comment has been minimized.

Copy link
Member

commented Feb 12, 2018

The bar for inclusion in the standard library is very high:
https://golang.org/doc/faq#x_in_std

and it kind of works backwards: first you need working, stable code and then submit a proposal for inclusion. Criterias are also not very clear at the moment, unfortunately.

Do you have some specific existing library that you want to propose for inclusion? I see there are already a few out there.

@bradfitz

This comment has been minimized.

Copy link
Member

commented Feb 12, 2018

I thought this had come up in the past, but I at least can't find it on the issue tracker. Maybe it was the mailing list. But I'm pretty sure it was rejected previously. I'll keep this open, though.

@mvdan

This comment has been minimized.

Copy link
Member

commented Feb 12, 2018

Have the x repos been considered for such a package, instead of the standard library?

@ericlagergren

This comment has been minimized.

Copy link
Contributor

commented Feb 13, 2018

@mvdan wasn't there an issue a while back about freezing new x/ repos?

@mvdan

This comment has been minimized.

Copy link
Member

commented Feb 13, 2018

@ericlagergren doesn't ring a bell, and I can't find such an issue now. Specific packages may be frozen, but I don't know about any general freeze rule on existing (or new) x repos.

@dominikh

This comment has been minimized.

Copy link
Member

commented Feb 13, 2018

@mvdan He may be referring to #17244

@ericlagergren

This comment has been minimized.

Copy link
Contributor

commented Feb 13, 2018

@dominikh yep, thanks. That's what I was remembering.

@rsc

This comment has been minimized.

Copy link
Contributor

commented Feb 26, 2018

Proposal: in crypto/rand, add

func UUID(rand io.Reader) (string, error)

only returns random UUIDs, not all the other ones.

@rsc rsc changed the title Proposal: uuid generator proposal: crypto/rand: add random uuid generator Feb 26, 2018

@randall77

This comment has been minimized.

Copy link
Contributor

commented Feb 26, 2018

(For those Googling for the UUID spec, the correct RFC number is 4122.)

@ericlagergren

This comment has been minimized.

Copy link
Contributor

commented Feb 27, 2018

@rsc

This comment has been minimized.

Copy link
Contributor

commented Mar 5, 2018

I'm withdrawing my proposal for crypto/rand. I don't have enough evidence that this is sufficient.

@rsc rsc changed the title proposal: crypto/rand: add random uuid generator proposal: add uuid generator to stdlib Mar 5, 2018

@rsc

This comment has been minimized.

Copy link
Contributor

commented Mar 5, 2018

I don't think we have enough information about what is needed in the standard library. I think for now the answer is to keep using third-party packages.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
9 participants
You can’t perform that action at this time.