Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor #120

Merged
merged 1 commit into from
Feb 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 6 additions & 8 deletions provider/appconfig/appconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@
for {
select {
case <-ticker.C:
out, err := a.load(ctx)
values, err := a.load(ctx)
if err != nil {
a.logger.WarnContext(
ctx, "Error when reloading from AWS AppConfig",
Expand All @@ -120,8 +120,8 @@
continue
}

if out != nil {
onChange(out)
if values != nil {
onChange(values)
}
case <-ctx.Done():
return nil
Expand Down Expand Up @@ -208,16 +208,14 @@
c.clientOnce.Do(func() {
if reflect.ValueOf(c.config).IsZero() {
if c.config, err = config.LoadDefaultConfig(ctx); err != nil {
err = fmt.Errorf("load default AWS config: %w", err)

Check warning on line 211 in provider/appconfig/appconfig.go

View check run for this annotation

Codecov / codecov/patch

provider/appconfig/appconfig.go#L211

Added line #L211 was not covered by tests

return
}
}

c.client = appconfigdata.NewFromConfig(c.config)
})

if err != nil {
return nil, fmt.Errorf("load client: %w", err)
}

return c.client, nil
return c.client, err
}
2 changes: 1 addition & 1 deletion provider/flag/option.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ func WithDelimiter(delimiter string) Option {
}
}

// WithNameSplitter provides the function used to split environment variable names into nested keys.
// WithNameSplitter provides the function used to split flag names into nested keys.
// If it returns an nil/[]string{}/[]string{""}, the variable will be ignored.
//
// For example, with the default splitter, an flag name like "parent.child.key"
Expand Down
2 changes: 1 addition & 1 deletion provider/pflag/option.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ func WithDelimiter(delimiter string) Option {
}
}

// WithNameSplitter provides the function used to split environment variable names into nested keys.
// WithNameSplitter provides the function used to split flag names into nested keys.
// If it returns an nil/[]string{}/[]string{""}, the variable will be ignored.
//
// For example, with the default splitter, an flag name like "parent.child.key"
Expand Down
Loading