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

Add method to get UUID as string without dashes. #60

Closed
wants to merge 2 commits into from

Conversation

limoli
Copy link

@limoli limoli commented Oct 3, 2017

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.

@coveralls
Copy link

coveralls commented Oct 3, 2017

Coverage Status

Coverage increased (+0.1%) to 96.703% when pulling 18cf3af on Limoli:master into 5bf94b6 on satori:master.

uuid.go Outdated
hex.Encode(buf[16:20], u[8:10])
hex.Encode(buf[20:], u[10:])

return string(buf)

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())?

Copy link
Author

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.

@coveralls
Copy link

coveralls commented Oct 4, 2017

Coverage Status

Coverage increased (+0.04%) to 96.604% when pulling b06ad57 on Limoli:master into 5bf94b6 on satori:master.

Copy link

@iaroslav-ciupin iaroslav-ciupin left a 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!

@iaroslav-ciupin
Copy link

@limoli Try to contact repo owner or people with write access to this repo and ask them to review and merge this PR

@dlsniper
Copy link
Contributor

dlsniper commented Oct 4, 2017

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.

@satori
Copy link
Owner

satori commented Jan 3, 2018

Closing as this method doesn't produce much value for a library in my opinion.
I would like to keep implementation as simple as possible.

@hgl
Copy link

hgl commented Mar 27, 2018

I need this change too. Dashless uuid strings aren't that uncommon in the real world.

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.

7 participants