replace env underscore to dot (#1229)

* replace env underscore to dot

* Compatible with dot format
pull/1235/head
longxboy 3 years ago committed by GitHub
parent d4ac341bc8
commit 38c9def445
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 7
      config/env/env.go

7
config/env/env.go vendored

@ -40,7 +40,12 @@ func (e *env) load(envStrings []string) []*config.KeyValue {
k = k[1:]
}
}
if strings.Contains(k, "_") {
kv = append(kv, &config.KeyValue{
Key: strings.Replace(k, "_", ".", -1),
Value: []byte(v),
})
}
kv = append(kv, &config.KeyValue{
Key: k,
Value: []byte(v),

Loading…
Cancel
Save