Skip to content

Commit bfb86fa

Browse files
authored
Add NewString Func (#73)
* added utility func * updated docs & function call
1 parent b5d0d36 commit bfb86fa

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

version4.go

+8
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,14 @@ func New() UUID {
1414
return Must(NewRandom())
1515
}
1616

17+
// NewString creates a new random UUID and returns it as a string or panics.
18+
// NewString is equivalent to the expression
19+
//
20+
// uuid.New().String()
21+
func NewString() string {
22+
return Must(NewRandom()).String()
23+
}
24+
1725
// NewRandom returns a Random (Version 4) UUID.
1826
//
1927
// The strength of the UUIDs is based on the strength of the crypto/rand

0 commit comments

Comments
 (0)