From 77ee7053049a2a82df01b1a2c0e5a7adbf47846c Mon Sep 17 00:00:00 2001 From: Jacob McSwain Date: Sun, 18 Feb 2024 16:53:28 -0600 Subject: [PATCH] config: don't print --- internal/config/config.go | 23 ----------------------- internal/config/config_test.go | 1 - 2 files changed, 24 deletions(-) diff --git a/internal/config/config.go b/internal/config/config.go index d82a4911..13aba62c 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -203,28 +203,5 @@ func GetConfig(cmd *cobra.Command) *Config { } } - if currentConfig.Debug { - fmt.Println(currentConfig.ToString()) - } - return ¤tConfig } - -// ToString returns a string representation of the configuration -func (config *Config) ToString() string { - return "Debug: " + strconv.FormatBool(config.Debug) + "\n" + - "Port: " + strconv.Itoa(config.Port) + "\n" + - "PasswordSalt: " + config.PasswordSalt + "\n" + - "OTLPEndpoint: " + config.OTLPEndpoint + "\n" + - "InitialAdminUserPassword: " + config.InitialAdminUserPassword + "\n" + - "HIBPAPIKey: " + config.HIBPAPIKey + "\n" + - "PostgresDSN: " + config.PostgresDSN + "\n" + - "PostgresUser: " + config.postgresUser + "\n" + - "PostgresPassword: " + config.postgresPassword + "\n" + - "PostgresHost: " + config.postgresHost + "\n" + - "PostgresPort: " + strconv.Itoa(config.postgresPort) + "\n" + - "PostgresDatabase: " + config.postgresDatabase + "\n" + - "CORSHosts: " + strings.Join(config.CORSHosts, ",") + "\n" + - "TrustedProxies: " + strings.Join(config.TrustedProxies, ",") + "\n" + - "MetricsPort: " + strconv.Itoa(config.MetricsPort) + "\n" -} diff --git a/internal/config/config_test.go b/internal/config/config_test.go index 1b0a8c1c..4f039480 100644 --- a/internal/config/config_test.go +++ b/internal/config/config_test.go @@ -13,5 +13,4 @@ func TestNoop(t *testing.T) { if conf.Debug != true { t.Error("Debug should be true") } - t.Log(conf.ToString()) }