fixup conditions
build / test (push) Has been cancelled Details
build / lint (push) Has been cancelled Details
codeql / analyze (go) (push) Has been cancelled Details

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
Василий Толстов 2024-01-15 01:15:20 +03:00
parent 7ec2354720
commit e25ad4f31b
1 changed files with 8 additions and 0 deletions

View File

@ -91,6 +91,10 @@ func (c *consulConfig) Init(opts ...options.Option) error {
}
func (c *consulConfig) Load(ctx context.Context, opts ...options.Option) 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 {
@ -153,6 +157,10 @@ func (c *consulConfig) Load(ctx context.Context, opts ...options.Option) error {
}
func (c *consulConfig) Save(ctx context.Context, opts ...options.Option) 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 {