mirror of
https://github.com/go-kratos/kratos.git
synced 2026-05-22 10:15:24 +02:00
replace env underscore to dot (#1229)
* replace env underscore to dot * Compatible with dot format
This commit is contained in:
Vendored
+6
-1
@@ -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),
|
||||
|
||||
Reference in New Issue
Block a user