From 57ce0f25bf4e3a1610f2083e9a4183eaac5c1fa8 Mon Sep 17 00:00:00 2001 From: Angira Kekteeva Date: Thu, 28 Jul 2022 17:27:18 +0400 Subject: [PATCH] [#607] Don't print env vars with empty values Signed-off-by: Angira Kekteeva --- cmd/s3-gw/app_settings.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/cmd/s3-gw/app_settings.go b/cmd/s3-gw/app_settings.go index cdd5633f..077f0f12 100644 --- a/cmd/s3-gw/app_settings.go +++ b/cmd/s3-gw/app_settings.go @@ -271,8 +271,13 @@ func newSettings() *viper.Viper { continue } + defaultValue := v.GetString(keys[i]) + if len(defaultValue) == 0 { + continue + } + 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()