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 01:18:51 +03:00
parent 712faba804
commit 1d33190529
3 changed files with 43 additions and 37 deletions

View File

@@ -87,6 +87,10 @@ func (c *consulConfig) Init(opts ...config.Option) error {
}
func (c *consulConfig) Load(ctx context.Context, opts ...config.LoadOption) error {
if c.opts.SkipLoad != nil && c.opts.SkipLoad(ctx, c) {
return nil
}
options := config.NewLoadOptions(opts...)
if err := config.DefaultBeforeLoad(ctx, c); err != nil && !c.opts.AllowFail {
@@ -149,6 +153,10 @@ func (c *consulConfig) Load(ctx context.Context, opts ...config.LoadOption) erro
}
func (c *consulConfig) 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 {