✨ Add Random Generator
This commit is contained in:
parent
5c1132e414
commit
1677a692d1
8 changed files with 142 additions and 53 deletions
36
gen_rand_examples_test.go
Normal file
36
gen_rand_examples_test.go
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
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)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue