Open timmattison opened 4 months ago
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).
View this failed invocation of the CLA check for more information.
For the most up to date status, view the checks section at the bottom of the pull request.
The "FromReader" functions were indeed added for testing purposes, but not for testing this package. This function makes it possible to have deterministic UUID's returned when validating a piece of software that uses this uuid package. I think NewV7 would be the most common way to get a V7 uuid. Using NewV7FromReader would only be used by software that needs this ability. That software would probably do something like:
import "crypto/rand"
var rander = rand.Read
...
u := NewV7FromReader(rander)
and then in their validation tests they would change what rander points to.
This function was in the version7.go file but it looks like it should only be available during testing. Leaving the function in the public API leaves open the possibility of people using it incorrectly and getting bad UUID v7 values.