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
Closed

proposal: add uuid generator to stdlib #23789

timakin opened this issue Feb 12, 2018 · 12 comments

Comments

@timakin
Copy link
Contributor

timakin 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
@rasky
Copy link
Member

rasky 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
Copy link
Contributor

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
Copy link
Member

mvdan commented Feb 12, 2018

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

@ericlagergren
Copy link
Contributor

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

@mvdan
Copy link
Member

mvdan 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
Copy link
Member

@mvdan He may be referring to #17244

@ericlagergren
Copy link
Contributor

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

@rsc
Copy link
Contributor

rsc 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
Copy link
Contributor

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

@ericlagergren
Copy link
Contributor

ericlagergren commented Feb 27, 2018 via email

@rsc
Copy link
Contributor

rsc 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
Copy link
Contributor

rsc 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
Development

No branches or pull requests

9 participants