nomino/gen_rand_examples_test.go

37 lines
669 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() {
option := nomino.WithGenerator(nomino.UUID())
str, _ := nomino.Make(nomino.NewConfig(option))
fmt.Println(str)
str, _ = nomino.Make(nomino.NewConfig(option))
fmt.Println(str)
str, _ = nomino.Make(nomino.NewConfig(option))
fmt.Println(str)
}
func ExampleRandom() {
option := nomino.WithGenerator(nomino.Random())
str, _ := nomino.Make(nomino.NewConfig(option))
fmt.Println(str)
}
func ExampleRandomLength() {
option := nomino.WithGenerator(nomino.Random(
nomino.RandomLength(32),
))
str, _ := nomino.Make(nomino.NewConfig(option))
fmt.Println(str)
}