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

math/rand: add Reader variable #16776

Open
dsnet opened this issue Aug 17, 2016 · 2 comments

Comments

@dsnet
Copy link
Member

commented Aug 17, 2016

The crypto/rand has both a Read function and a Reader object for passing in as an io.Reader. The math/rand package only has a Read function and no Reader object.

Should we add a Reader to math/rand to make it consistent with crypto/rand?

@dsnet dsnet added this to the Unplanned milestone Aug 17, 2016

@bradfitz

This comment has been minimized.

Copy link
Member

commented Aug 17, 2016

I thought this was a dup, but I was thinking of #8330 which went most of the way, but not all the way.

I still think there was an open bug or thread about this, but I don't remember the outcome.

@dsnet

This comment has been minimized.

Copy link
Member Author

commented Aug 17, 2016

When #8330 was first implemented, I noticed that it didn't include an implementation for a Reader object. Back then, I didn't speak up because it's not a big deal.

I think it'd be nice, but everytime I really wanted to use random Reader, I just do rand.New(rand.NewSource(0)) and move on in life.

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