Skip to content

Commit

Permalink
refactored string builing of oldKey and newKey
Browse files Browse the repository at this point in the history
  • Loading branch information
spencerugbo committed Jun 17, 2024
1 parent f1d4a55 commit e4e8ca6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/core/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit e4e8ca6

Please sign in to comment.