Skip to content

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

Open
@satazor

Description

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions