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

Update documentation and code for Invalid Variant #91

Open
toothrot opened this issue Sep 21, 2021 · 0 comments
Open

Update documentation and code for Invalid Variant #91

toothrot opened this issue Sep 21, 2021 · 0 comments

Comments

@toothrot
Copy link

It would be nice if the uuid.Invalid documentation or the (uuid.UUID).Variant() documentation mentioned this in addition to the readme, as it was confusing until I saw 3943dc5. I had read through the documentation, code, and tests before the readme of the repository, so there was a little wasted effort and confusion.

Specifically, the unit tests are a little misleading, as uuid.Parse() returns an error in the Invalid cases:

uuid/uuid_test.go

Lines 62 to 67 in 44b5fee

{"f47ac10b158cc-5372-a567-0e02b2c3d479", 0, Invalid, false},
{"f47ac10b-58cc25372-a567-0e02b2c3d479", 0, Invalid, false},
{"f47ac10b-58cc-53723a567-0e02b2c3d479", 0, Invalid, false},
{"f47ac10b-58cc-5372-a56740e02b2c3d479", 0, Invalid, false},
{"f47ac10b-58cc-5372-a567-0e02-2c3d479", 0, Invalid, false},
{"g47ac10b-58cc-4372-a567-0e02b2c3d479", 0, Invalid, false},

The variant is never checked in the unit tests in an error scenario:

uuid/uuid_test.go

Lines 99 to 101 in 44b5fee

if err != nil {
return
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant