-
Notifications
You must be signed in to change notification settings - Fork 166
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
Adding Bytes() to get slice representation of ULID #49
Conversation
@sabify As silly as it might sound, can you please add a test? 😇 It would be good for the test to make sure the returned slice is distinct from the original ULID array in the ways that are important. |
ulid_test.go
Outdated
id := ulid.MustNew(ulid.Timestamp(tt), entropy) | ||
bid := id.Bytes() | ||
bid[len(bid)-1]++ | ||
if bytes.Compare(id.Bytes(), bid) == 0 { |
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.
S1004: should use bytes.Equal(id.Bytes(), bid) instead (from gosimple
)
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.
🤗
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.
😉
Thanks! |
No description provided.