Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
Василий Толстов 2020-12-08 00:41:14 +03:00
parent b7b28f6b9a
commit e08276c2e2
2 changed files with 2 additions and 5 deletions

View File

@ -29,8 +29,7 @@ func TestNoop(t *testing.T) {
return nil
}
cfg := config.NewConfig(config.Struct(conf),config.BeforeLoad(blfn),config.AfterLoad(alfn))
cfg := config.NewConfig(config.Struct(conf), config.BeforeLoad(blfn), config.AfterLoad(alfn))
if err := cfg.Init(); err != nil {
t.Fatal(err)
}
@ -56,6 +55,4 @@ func TestNoop(t *testing.T) {
t.Fatal("AfterLoad option not working")
}
}

View File

@ -50,7 +50,7 @@ func (s *service) Init(opts ...Option) error {
if s.opts.Configs != nil {
for _, c := range s.opts.Configs {
if err := c.Init(config.Context(s.opts.Context) ); err != nil {
if err := c.Init(config.Context(s.opts.Context)); err != nil {
return err
}
}