support multiple provider for With func

This commit is contained in:
yanghao05
2023-06-13 10:01:40 +08:00
parent 277c93c584
commit 62102819bc

View File

@@ -46,8 +46,11 @@ type ProviderContainer struct {
type Providers []ProviderContainer type Providers []ProviderContainer
func (p Providers) With(pcs Providers) Providers { func (p Providers) With(pcs ...Providers) Providers {
return append(p, pcs...) for _, pc := range pcs {
p = append(p, pc...)
}
return p
} }
func (p Providers) Provide(config *viper.Viper) error { func (p Providers) Provide(config *viper.Viper) error {