-
Notifications
You must be signed in to change notification settings - Fork 247
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
lib: migrate to a maintained UUID library #1654
Conversation
Not required for the package change itself, but for next-up work of converting from string to uuid in structs.
user/cache.go
Outdated
if idStr == "" { | ||
return false | ||
} | ||
return c.UserExistsUUID(uuid.FromStringOrNil(id)) | ||
id, _ := uuid.Parse(idStr) |
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.
This is minor, but feels off to have one error condition (empty string) return false and any others be ignored. Maybe check for all in one go?
id, err := uuid.Parse(idStr)
if err != nil {
return false
}
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.
oh, yeah I like that much better -- prevents the possibility of an invalid UUID returning true if there was a nil user
|
@dctalbot no, I was trying to figure out why |
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.
lgtm
make check
to catch common errors. Fixed any that came up.Description:
Switches to a maintained UUID library.