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

Signed-off-by: Angira Kekteeva <kira@nspcc.ru>
This commit is contained in:
Angira Kekteeva 2022-08-02 00:47:20 +04:00 committed by Kirillov Denis
parent ee49355bb7
commit 9d4049cfe3

View file

@ -182,8 +182,13 @@ func settings() *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", Prefix, strings.ToUpper(k), v.Get(keys[i])) fmt.Printf("%s_%s = %s\n", Prefix, strings.ToUpper(k), defaultValue)
} }
fmt.Println() fmt.Println()