[#607] Don't print env vars with empty values

Signed-off-by: Angira Kekteeva <kira@nspcc.ru>
This commit is contained in:
Angira Kekteeva 2022-07-28 17:27:18 +04:00 committed by Kirillov Denis
parent 08898f4fb4
commit 57ce0f25bf

View file

@ -271,8 +271,13 @@ func newSettings() *viper.Viper {
continue continue
} }
defaultValue := v.GetString(keys[i])
if len(defaultValue) == 0 {
continue
}
k := strings.Replace(keys[i], ".", "_", -1) k := strings.Replace(keys[i], ".", "_", -1)
fmt.Printf("%s_%s = %v\n", envPrefix, strings.ToUpper(k), v.Get(keys[i])) fmt.Printf("%s_%s = %s\n", envPrefix, strings.ToUpper(k), defaultValue)
} }
fmt.Println() fmt.Println()