♻️ Modify UUID to allow for other versions.
This commit is contained in:
parent
f121b7dbce
commit
fee2e3cc2f
4 changed files with 55 additions and 24 deletions
|
|
@ -7,30 +7,34 @@ import (
|
|||
)
|
||||
|
||||
func ExampleUUID() {
|
||||
option := nomino.WithGenerator(nomino.UUID())
|
||||
gen := nomino.UUID(nil)
|
||||
|
||||
str, _ := nomino.Make(nomino.NewConfig(option))
|
||||
str, _ := gen.Make()
|
||||
fmt.Println(str)
|
||||
|
||||
str, _ = nomino.Make(nomino.NewConfig(option))
|
||||
str, _ = gen.Make()
|
||||
fmt.Println(str)
|
||||
}
|
||||
|
||||
func ExampleUUID_v7() {
|
||||
gen := nomino.UUID(nomino.UUIDv7)
|
||||
|
||||
str, _ := gen.Make()
|
||||
fmt.Println(str)
|
||||
|
||||
str, _ = nomino.Make(nomino.NewConfig(option))
|
||||
str, _ = gen.Make()
|
||||
fmt.Println(str)
|
||||
|
||||
str, _ = gen.Make()
|
||||
fmt.Println(str)
|
||||
}
|
||||
|
||||
func ExampleRandom() {
|
||||
option := nomino.WithGenerator(nomino.Random())
|
||||
|
||||
str, _ := nomino.Make(nomino.NewConfig(option))
|
||||
str, _ := nomino.Random().Make()
|
||||
fmt.Println(str)
|
||||
}
|
||||
|
||||
func ExampleRandomLength() {
|
||||
option := nomino.WithGenerator(nomino.Random(
|
||||
nomino.RandomLength(32),
|
||||
))
|
||||
|
||||
str, _ := nomino.Make(nomino.NewConfig(option))
|
||||
str, _ := nomino.Random(nomino.RandomLength(32)).Make()
|
||||
fmt.Println(str)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue