-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d2b7a49
commit 9dc15ca
Showing
4 changed files
with
20 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// uuidv7 is a wrapper around google's uuid package. | ||
package uuidv7 | ||
|
||
import ( | ||
"github.com/google/uuid" | ||
"go.inout.gg/foundations/must" | ||
) | ||
|
||
// Must returns a new random UUID. It panics if there is an error. | ||
func Must() uuid.UUID { | ||
return must.Must(uuid.NewV7()) | ||
} | ||
|
||
// FromString parses a UUID from a string. | ||
func FromString(s string) (uuid.UUID, error) { | ||
return uuid.Parse(s) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters