From 6fd2db8d0be60d27318c014c3accdaf69efe49c4 Mon Sep 17 00:00:00 2001 From: Manav Rathi Date: Fri, 4 Apr 2025 10:54:22 +0530 Subject: [PATCH] Augment not replace --- server/pkg/utils/config/config.go | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/server/pkg/utils/config/config.go b/server/pkg/utils/config/config.go index 7254ff7b3e..0aa995a3d8 100644 --- a/server/pkg/utils/config/config.go +++ b/server/pkg/utils/config/config.go @@ -39,11 +39,9 @@ func ConfigureViper(environment string) error { // Set the prefix for the environment variables that Viper will look for. viper.SetEnvPrefix("ENTE") // Ask Viper to look for underscores (instead of dots) for nested configs. - viper.SetEnvKeyReplacer(strings.NewReplacer(`.`, `_`)) - - // Also replace "-" with underscores since "-" cannot be used in - // environment variable names. - viper.SetEnvKeyReplacer(strings.NewReplacer(`-`, `_`)) + // Also replace "-" with underscores since "-" cannot be used in environment + // variable names. + viper.SetEnvKeyReplacer(strings.NewReplacer(".", "_", "-", "_")) viper.SetConfigFile("configurations/" + environment + ".yaml") err := viper.ReadInConfig()