You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Replace the == 4 with == 3 for example, and you'll see the failure.
With the must builtin per #575, you could rewrite _isV4: true & uuid.Version(id) == 4 into _isV4: must(uuid.Version(id) == 4, "id must be an UUID v4"), for example. A bit nicer for sure, although what you can do today still gets the job done.
I'm going to convert this into a discussion, because I feel like it's a valid question that others might find useful in the future, and I don't want to close it as a duplicate issue of the must built-in :)
While there is a constraint for a valid UUID, there isn't a constraint for a particular version.
Describe the solution you'd like
A clear and concise description of what you want to happen.
Something like:
Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
There is an operation in the uuid package that returns the version, but I couldn't find a good way to use this as a constraint.
Additional context
Add any other context or screenshots about the feature request here.
The text was updated successfully, but these errors were encountered: