✨ Add extra Options to Make
This commit is contained in:
parent
9402d80704
commit
db2f12522d
3 changed files with 42 additions and 4 deletions
|
|
@ -11,3 +11,20 @@ func ExampleMake_basic() {
|
|||
out, _ := nomino.Make(nomino.NewConfig())
|
||||
fmt.Println(out)
|
||||
}
|
||||
|
||||
func ExampleMake_withExtraOptions() {
|
||||
gen := nomino.Incremental()
|
||||
conf := nomino.NewConfig(
|
||||
nomino.WithGenerator(gen),
|
||||
nomino.WithPrefix("pre"),
|
||||
)
|
||||
|
||||
st, _ := nomino.Make(conf, nomino.WithOriginal("foobar"))
|
||||
fmt.Println(st)
|
||||
st, _ = nomino.Make(conf, nomino.WithOriginal("baz"))
|
||||
fmt.Println(st)
|
||||
|
||||
// Output:
|
||||
// pre_0_foobar.txt
|
||||
// pre_1_baz.txt
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue