Skip to content

rand.Reader.Read vs rand.Read #3248

@snyff

Description

@snyff

Looking at the code in uuid.go (

_, err := rand.Reader.Read(uuid)
):

I think it would be better to use something like:

_, err := io.ReadFull(rand.Reader, uuid)

or

_, err := rand.Read(uuid)

To guarantee filling the buffer (or returns a non-nil error)

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions