Skip to content

Added feature: Added IsNil() Method for uuid. Also updated the Nil variable and Namespace constants documentation to reference RFC 9562 (the current standard obsoleting RFC 4122).#213

Open
hamid-JTG wants to merge 2 commits into
google:masterfrom
hamid-JTG:feature-add-is-nil

Conversation

@hamid-JTG

@hamid-JTG hamid-JTG commented Apr 10, 2026

Copy link
Copy Markdown

This PR adds a convenience method IsNil() to the UUID type.

While it is currently possible to check for a nil UUID by comparing against the package-level Nil variable, providing an IsNil() method is more idiomatic in Go and improves code readability when performing validation checks.

Example:

u, _ := uuid.Parse(input)
if u.IsNil() {
    // handle nil uuid
}

Also updated the Nil variable and Namespace constants documentation to reference RFC 9562 (the current standard obsoleting RFC 4122).
image

@hamid-JTG
hamid-JTG requested a review from a team as a code owner April 10, 2026 13:05
@hamid-JTG hamid-JTG changed the title Added feature: Added IsNil Method for uuid. Added feature: Added IsNil() Method for uuid. Also updated the Nil variable and Namespace constants documentation to reference RFC 9562 (the current standard obsoleting RFC 4122). Apr 10, 2026
@hamid-JTG
hamid-JTG force-pushed the feature-add-is-nil branch from 2f34762 to b813281 Compare April 10, 2026 14:05
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

Successfully merging this pull request may close these issues.

1 participant