Skip to content

lib: migrate to a maintained UUID library#1654

Merged
mastercactapus merged 7 commits into
masterfrom
migrate-uuid-library
Jun 25, 2021
Merged

lib: migrate to a maintained UUID library#1654
mastercactapus merged 7 commits into
masterfrom
migrate-uuid-library

Conversation

@mastercactapus
Copy link
Copy Markdown
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
Comment thread 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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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