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

lib: migrate to a maintained UUID library #1654

Merged
merged 7 commits into from
Jun 25, 2021
Merged

Conversation

mastercactapus
Copy link
Member

  • Identified the issue which this PR solves.
  • Read the CONTRIBUTING document.
  • Code builds clean without any errors or warnings.
  • Added appropriate tests for any new functionality.
  • All new and existing tests passed.
  • Added comments in the code, where necessary.
  • Ran make check to catch common errors. Fixed any that came up.

Description:
Switches to a maintained UUID library.

@mastercactapus mastercactapus changed the title lib: migrate to new UUID library lib: migrate to a maintained UUID library Jun 23, 2021
user/cache.go Outdated
Comment on lines 32 to 35
if idStr == "" {
return false
}
return c.UserExistsUUID(uuid.FromStringOrNil(id))
id, _ := uuid.Parse(idStr)
Copy link
Contributor

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
}

Copy link
Member Author

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
Copy link
Contributor

dctalbot commented Jun 23, 2021

graphql2/gqlgen.yml is still specifying github.com/satori/go.uuid.UUID, is that needed for compatibility?

@mastercactapus
Copy link
Member Author

graphql2/gqlgen.yml is still specifying github.com/satori/go.uuid.UUID, is that needed for compatibility?

@dctalbot no, I was trying to figure out why go generate kept demanding a hash be in the sum file, that would be why. ty

Copy link
Contributor

@m17ch m17ch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@mastercactapus mastercactapus merged commit 2145a49 into master Jun 25, 2021
@mastercactapus mastercactapus deleted the migrate-uuid-library branch June 25, 2021 17:24
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.

3 participants