diff --git a/common/config_utils.go b/common/config_utils.go index b17e9ce..44c93f6 100644 --- a/common/config_utils.go +++ b/common/config_utils.go @@ -47,7 +47,9 @@ func loadFromEnvInner(prefix string, conf reflect.Value, defaultValue string) { } func toUnderscoreUpper(key string) string { - matchFirstCap := regexp.MustCompile("([a-z])([A-Z]+[a-z]+)") + key = strings.Trim(key, "_") + matchFirstCap := regexp.MustCompile("([a-z])([A-Z]+)") s2 := matchFirstCap.ReplaceAllString(key, "${1}_${2}") + // dtmimp.Logf("loading from env: %s", strings.ToUpper(s2)) return strings.ToUpper(s2) }