change options

This commit is contained in:
yanghao05
2023-04-28 14:17:44 +08:00
parent e6e3df17fa
commit 3a9d5492f8
11 changed files with 41 additions and 31 deletions

View File

@@ -4,12 +4,13 @@ import (
"time"
"github.com/rogeecn/atom/container"
"github.com/rogeecn/atom/providers"
"github.com/rogeecn/atom/utils/opt"
"github.com/brianvoe/gofakeit/v6"
)
func Provide(o *providers.Options) error {
func Provide(opts ...opt.Option) error {
o := opt.New(opts...)
return container.Container.Provide(func() (*gofakeit.Faker, error) {
faker := gofakeit.New(time.Now().UnixNano())
gofakeit.SetGlobalFaker(faker)