Unverified Commit 42c394e2 authored by astaxie's avatar astaxie Committed by GitHub

Merge pull request #3263 from guomao545/master

 Support return middle level value
parents 5051d902 39fc30b8
......@@ -290,12 +290,15 @@ func (c *ConfigContainer) getData(key string) (interface{}, error) {
keys := strings.Split(key, ".")
tmpData := c.data
for _, k := range keys {
for idx, k := range keys {
if v, ok := tmpData[k]; ok {
switch v.(type) {
case map[string]interface{}:
{
tmpData = v.(map[string]interface{})
if idx == len(keys) - 1 {
return tmpData, nil
}
}
default:
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment