-
Notifications
You must be signed in to change notification settings - Fork 600
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
Add method to get UUID as string without dashes. #60
Conversation
uuid.go
Outdated
hex.Encode(buf[16:20], u[8:10]) | ||
hex.Encode(buf[20:], u[10:]) | ||
|
||
return string(buf) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is it better to use hex.EncodeToString(u.Bytes())
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it is better and more coincise. Thank you for the advice. Tomorrow I will push it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great, I also need this change merged to master!
@limoli Try to contact repo owner or people with write access to this repo and ask them to review and merge this PR |
This is a pointless change as it can be done and used outside of this package. I am against it as it pollutes the code with a method which is not compliant with the standard uuid representation. |
Closing as this method doesn't produce much value for a library in my opinion. |
I need this change too. Dashless uuid strings aren't that uncommon in the real world. |
I need the possibility to have an UUID string without dashes in my project.
I didn't want to use strings package to manage it since it could be a new simple functionality.