Skip to content

Commit

Permalink
chore: deprecate unused configx option
Browse files Browse the repository at this point in the history
  • Loading branch information
alnr committed Sep 18, 2024
1 parent f03cb99 commit 3d815ba
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 15 deletions.
5 changes: 2 additions & 3 deletions configx/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,9 @@ func WithUserProviders(providers ...koanf.Provider) OptionModifier {
}
}

// DEPRECATED without replacement. This option is a no-op.
func OmitKeysFromTracing(keys ...string) OptionModifier {
return func(p *Provider) {
p.excludeFieldsFromTracing = keys
}
return func(*Provider) {}
}

func AttachWatcher(watcher func(event watcherx.Event, err error)) OptionModifier {
Expand Down
22 changes: 10 additions & 12 deletions configx/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,11 @@ type Provider struct {
*koanf.Koanf
immutables, exceptImmutables []string

schema []byte
flags *pflag.FlagSet
validator *jsonschema.Schema
onChanges []func(watcherx.Event, error)
onValidationError func(k *koanf.Koanf, err error)
excludeFieldsFromTracing []string
schema []byte
flags *pflag.FlagSet
validator *jsonschema.Schema
onChanges []func(watcherx.Event, error)
onValidationError func(k *koanf.Koanf, err error)

forcedValues []tuple
baseValues []tuple
Expand Down Expand Up @@ -91,12 +90,11 @@ func New(ctx context.Context, schema []byte, modifiers ...OptionModifier) (*Prov
l.Out = io.Discard

p := &Provider{
schema: schema,
validator: validator,
onValidationError: func(k *koanf.Koanf, err error) {},
excludeFieldsFromTracing: []string{"dsn", "secret", "password", "key"},
logger: logrusx.New("discarding config logger", "", logrusx.UseLogger(l)),
Koanf: koanf.NewWithConf(koanf.Conf{Delim: Delimiter, StrictMerge: true}),
schema: schema,
validator: validator,
onValidationError: func(k *koanf.Koanf, err error) {},
logger: logrusx.New("discarding config logger", "", logrusx.UseLogger(l)),
Koanf: koanf.NewWithConf(koanf.Conf{Delim: Delimiter, StrictMerge: true}),
}

for _, m := range modifiers {
Expand Down

0 comments on commit 3d815ba

Please sign in to comment.