mirror of
https://github.com/astaxie/beego.git
synced 2025-07-06 01:50:19 +00:00
Update config suport environment variable logic
This commit is contained in:
@ -57,6 +57,9 @@ func (js *JSONConfig) ParseData(data []byte) (Configer, error) {
|
||||
}
|
||||
x.data["rootArray"] = wrappingArray
|
||||
}
|
||||
|
||||
x.data = ChooseRealValueForMap(x.data)
|
||||
|
||||
return x, nil
|
||||
}
|
||||
|
||||
@ -250,18 +253,11 @@ func (c *JSONConfigContainer) getData(key string) interface{} {
|
||||
}
|
||||
}
|
||||
}
|
||||
if env, ok := Getenv(curValue); ok {
|
||||
return env
|
||||
}
|
||||
return curValue
|
||||
}
|
||||
if v, ok := c.data[key]; ok {
|
||||
if env, ok := Getenv(v); ok {
|
||||
return env
|
||||
}
|
||||
return v
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user