fixup conditions
Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
8
env.go
8
env.go
@@ -40,6 +40,10 @@ func (c *envConfig) Init(opts ...config.Option) error {
|
||||
}
|
||||
|
||||
func (c *envConfig) Load(ctx context.Context, opts ...config.LoadOption) error {
|
||||
if c.opts.SkipLoad != nil && c.opts.SkipLoad(ctx, c) {
|
||||
return nil
|
||||
}
|
||||
|
||||
if err := config.DefaultBeforeLoad(ctx, c); err != nil && !c.opts.AllowFail {
|
||||
return err
|
||||
}
|
||||
@@ -316,6 +320,10 @@ func fillValues(ctx context.Context, valueOf reflect.Value, structTag string) er
|
||||
}
|
||||
|
||||
func (c *envConfig) Save(ctx context.Context, opts ...config.SaveOption) error {
|
||||
if c.opts.SkipSave != nil && c.opts.SkipSave(ctx, c) {
|
||||
return nil
|
||||
}
|
||||
|
||||
options := config.NewSaveOptions(opts...)
|
||||
|
||||
if err := config.DefaultBeforeSave(ctx, c); err != nil && !c.opts.AllowFail {
|
||||
|
Reference in New Issue
Block a user