Skip to content

TryParse function#215

Open
piotrkowalczuk wants to merge 1 commit intogoogle:masterfrom
piotrkowalczuk:try-parse
Open

TryParse function#215
piotrkowalczuk wants to merge 1 commit intogoogle:masterfrom
piotrkowalczuk:try-parse

Conversation

@piotrkowalczuk
Copy link
Copy Markdown

Add TryParse function that completes the parsing API gradation:

  • Parse - returns (UUID, error), caller handles the error
  • TryParse - returns NullUUID, no error, no panic
  • MustParse - returns UUID, panics on failure

TryParse is useful when the caller wants to attempt parsing without dealing with explicit error handling or risking a panic. It returns a NullUUID with Valid set to true on success and false on failure.

@piotrkowalczuk piotrkowalczuk requested a review from a team as a code owner April 14, 2026 12:30
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