fixup conditions
Some checks failed
build / test (push) Has been cancelled
build / lint (push) Has been cancelled
codeql / analyze (go) (push) Has been cancelled

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
2024-01-15 02:02:50 +03:00
parent b8b8803c26
commit 5f9029c496
3 changed files with 19 additions and 2 deletions

View File

@@ -156,6 +156,10 @@ func (c *flagConfig) Init(opts ...config.Option) error {
}
func (c *flagConfig) Load(ctx context.Context, opts ...config.LoadOption) error {
if c.opts.SkipLoad != nil && c.opts.SkipLoad(ctx, c) {
return nil
}
options := config.NewLoadOptions(opts...)
_ = options
@@ -174,6 +178,10 @@ func (c *flagConfig) Load(ctx context.Context, opts ...config.LoadOption) error
}
func (c *flagConfig) Save(ctx context.Context, opts ...config.SaveOption) error {
if c.opts.SkipSave != nil && c.opts.SkipSave(ctx, c) {
return nil
}
if err := config.DefaultBeforeSave(ctx, c); err != nil && !c.opts.AllowFail {
return err
}