From fe278f777242fdffe9dd5426dbeecb74ee41810a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mike=20Schw=C3=B6rer?= Date: Sun, 28 May 2023 18:21:02 +0200 Subject: [PATCH] v0.0.124 --- langext/uuid.go | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/langext/uuid.go b/langext/uuid.go index b00914e..faba02a 100644 --- a/langext/uuid.go +++ b/langext/uuid.go @@ -41,6 +41,14 @@ func NewHexUUID() (string, error) { return string(dst), nil } +func MustHexUUID() string { + v, err := NewHexUUID() + if err != nil { + panic(err) + } + return v +} + func NewUpperHexUUID() (string, error) { uuid, err := NewUUID() if err != nil { @@ -64,6 +72,14 @@ func NewUpperHexUUID() (string, error) { return strings.ToUpper(string(dst)), nil } +func MustUpperHexUUID() string { + v, err := NewUpperHexUUID() + if err != nil { + panic(err) + } + return v +} + func NewRawHexUUID() (string, error) { uuid, err := NewUUID() if err != nil { @@ -83,6 +99,14 @@ func NewRawHexUUID() (string, error) { return strings.ToUpper(string(dst)), nil } +func MustRawHexUUID() string { + v, err := NewRawHexUUID() + if err != nil { + panic(err) + } + return v +} + func NewBracesUUID() (string, error) { uuid, err := NewUUID() if err != nil { @@ -108,6 +132,14 @@ func NewBracesUUID() (string, error) { return strings.ToUpper(string(dst)), nil } +func MustBracesUUID() string { + v, err := NewBracesUUID() + if err != nil { + panic(err) + } + return v +} + func NewParensUUID() (string, error) { uuid, err := NewUUID() if err != nil { @@ -132,3 +164,11 @@ func NewParensUUID() (string, error) { return strings.ToUpper(string(dst)), nil } + +func MustParensUUID() string { + v, err := NewParensUUID() + if err != nil { + panic(err) + } + return v +}