From c3c01d32d147ee353ddb08e5f0d57857a7867387 Mon Sep 17 00:00:00 2001 From: Spencer Date: Mon, 17 Jun 2024 12:46:31 +0100 Subject: [PATCH] refactored string builing of oldKey and newKey --- .../github.com/nginx/agent/v2/src/core/config/config.go | 4 ++-- .../github.com/nginx/agent/v2/src/core/config/config.go | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/test/integration/vendor/github.com/nginx/agent/v2/src/core/config/config.go b/test/integration/vendor/github.com/nginx/agent/v2/src/core/config/config.go index ab46af64ab..5703bf109d 100644 --- a/test/integration/vendor/github.com/nginx/agent/v2/src/core/config/config.go +++ b/test/integration/vendor/github.com/nginx/agent/v2/src/core/config/config.go @@ -153,8 +153,8 @@ func RegisterFlags() { return } - oldKey := strings.ToUpper(fmt.Sprintf("%s%s%s", LegacyEnvPrefix, agent_config.KeyDelimiter, strings.ReplaceAll(flag.Name, "-", "_"))) - newKey := strings.ToUpper(fmt.Sprintf("%s%s%s", EnvPrefix, agent_config.KeyDelimiter, strings.ReplaceAll(flag.Name, "-", "_"))) + oldKey := strings.ToUpper(LegacyEnvPrefix + agent_config.KeyDelimiter + strings.ReplaceAll(flag.Name, "-", agent_config.KeyDelimiter)) + newKey := strings.ToUpper(EnvPrefix + agent_config.KeyDelimiter + strings.ReplaceAll(flag.Name, "-", agent_config.KeyDelimiter)) if os.Getenv(oldKey) != "" && os.Getenv(newKey) == "" { if err := os.Setenv(newKey, os.Getenv(oldKey)); err != nil { diff --git a/test/performance/vendor/github.com/nginx/agent/v2/src/core/config/config.go b/test/performance/vendor/github.com/nginx/agent/v2/src/core/config/config.go index ab46af64ab..5703bf109d 100644 --- a/test/performance/vendor/github.com/nginx/agent/v2/src/core/config/config.go +++ b/test/performance/vendor/github.com/nginx/agent/v2/src/core/config/config.go @@ -153,8 +153,8 @@ func RegisterFlags() { return } - oldKey := strings.ToUpper(fmt.Sprintf("%s%s%s", LegacyEnvPrefix, agent_config.KeyDelimiter, strings.ReplaceAll(flag.Name, "-", "_"))) - newKey := strings.ToUpper(fmt.Sprintf("%s%s%s", EnvPrefix, agent_config.KeyDelimiter, strings.ReplaceAll(flag.Name, "-", "_"))) + oldKey := strings.ToUpper(LegacyEnvPrefix + agent_config.KeyDelimiter + strings.ReplaceAll(flag.Name, "-", agent_config.KeyDelimiter)) + newKey := strings.ToUpper(EnvPrefix + agent_config.KeyDelimiter + strings.ReplaceAll(flag.Name, "-", agent_config.KeyDelimiter)) if os.Getenv(oldKey) != "" && os.Getenv(newKey) == "" { if err := os.Setenv(newKey, os.Getenv(oldKey)); err != nil {