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

uuid.Parse Function Does Not Handle Leading/Trailing Spaces in UUIDs #147

Open
mahmoudahmedd opened this issue Dec 31, 2023 · 0 comments
Open

Comments

@mahmoudahmedd
Copy link

The uuid.Parse function currently treats UUID strings with leading or trailing spaces as valid.

_, parseError := uuid.Parse(" a3bb189e-8bf9-3888-9912-ace4e6543002 ")
when parsing a UUID string like " a3bb189e-8bf9-3888-9912-ace4e6543002 " (with spaces around it), the function does not return an error (parseError is nil). https://go.dev/play/p/8eIO_36dfdD

It would be beneficial to either treat such strings as invalid ?

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