google / google/uuid

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

Open
#165 4 comments 3 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
6.1k
Forks
440
PR merge metrics
No merged PRs in 30d

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.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.