|
|
|
@ -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) |
|
|
|
} |
|
|
|
|