google / google/uuid

Update documentation and code for Invalid Variant

Open
#91 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
6.1k
Forks
440
PR merge metrics
No merged PRs in 30d

Description

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 3943dc54a8bab7acdb1584b25ee8bd4fb22750b6. 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: https://github.com/google/uuid/blob/44b5fee7c49cf3bcdf723f106b36d56ef13ccc88/uuid_test.go#L62-L67

The variant is never checked in the unit tests in an error scenario:
https://github.com/google/uuid/blob/44b5fee7c49cf3bcdf723f106b36d56ef13ccc88/uuid_test.go#L99-L101

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.