nomino/gen_rand_examples_test.go

41 lines
573 B
Go
Raw Normal View History

2025-03-15 15:36:43 -05:00
package nomino_test
import (
"fmt"
"codeberg.org/danjones000/nomino"
)
func ExampleUUID() {
gen := nomino.UUID(nil)
2025-03-15 15:36:43 -05:00
str, _ := gen.Make()
2025-03-15 15:36:43 -05:00
fmt.Println(str)
str, _ = gen.Make()
fmt.Println(str)
}
func ExampleUUID_v7() {
gen := nomino.UUID(nomino.UUIDv7)
str, _ := gen.Make()
2025-03-15 15:36:43 -05:00
fmt.Println(str)
str, _ = gen.Make()
fmt.Println(str)
str, _ = gen.Make()
2025-03-15 15:36:43 -05:00
fmt.Println(str)
}
func ExampleRandom() {
str, _ := nomino.Random().Make()
2025-03-15 15:36:43 -05:00
fmt.Println(str)
}
func ExampleRandomLength() {
str, _ := nomino.Random(nomino.RandomLength(32)).Make()
2025-03-15 15:36:43 -05:00
fmt.Println(str)
}