config: init before load

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
Василий Толстов 2020-12-20 23:08:40 +03:00
parent aa6afdf440
commit 8feab7cc48

View File

@ -45,6 +45,9 @@ type Config interface {
func Load(ctx context.Context, cs ...Config) error { func Load(ctx context.Context, cs ...Config) error {
var err error var err error
for _, c := range cs { for _, c := range cs {
if err = c.Init(); err != nil {
return err
}
if err = c.Load(ctx); err != nil { if err = c.Load(ctx); err != nil {
return err return err
} }