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-husain wants to merge 2 commits intogoogle:masterfrom
hamid-husain:feature-add-is-nil

Conversation

@hamid-husain
Copy link
Copy Markdown

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

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-husain hamid-husain requested a review from a team as a code owner April 10, 2026 13:05
@hamid-husain hamid-husain 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
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