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

Allow to use something different than time.Now when generating uuids that have a time component #165

Open
satazor opened this issue Jul 29, 2024 · 1 comment

Comments

@satazor
Copy link

satazor commented Jul 29, 2024

Allow to use something different than time.Now when generating uuids that have a time component.

This is useful for:

  • Tests
  • In rare cases where you want to encode a timestamp different than the current time in the id, such as an expiration date.

The package at https://github.com/gofrs/uuid seems to have this functionality, see https://pkg.go.dev/github.com/gofrs/uuid/v5#WithEpochFunc. I would love to have something similar.

@it512
Copy link
Contributor

it512 commented Jul 30, 2024

If you have special requirements, please use uuidv8

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

No branches or pull requests

2 participants