From 63f9ef779ae35f04c6101eef21f70b1acbedb3e4 Mon Sep 17 00:00:00 2001 From: doxsch <28098153+doxsch@users.noreply.github.com> Date: Wed, 13 Dec 2023 13:41:01 +0100 Subject: [PATCH] fix: merge camelCase properties from config file correctly with environment variables --- config.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/config.go b/config.go index ac7e728..3435f0c 100644 --- a/config.go +++ b/config.go @@ -61,7 +61,10 @@ func newConfig(logger *zap.Logger) (Config, error) { if configFilepath == "" { logger.Info("the env variable '" + envKey + "' is not set, therefore no YAML config will be loaded") } else { - err := k.Load(file.Provider(configFilepath), yaml.Parser()) + err := k.Load(file.Provider(configFilepath), yaml.Parser(), koanf.WithMergeFunc(func(src, dest map[string]interface{}) error { + dest = src + return nil + })) if err != nil { return Config{}, fmt.Errorf("failed to parse YAML config: %w", err) }