mirror of
https://github.com/astaxie/beego.git
synced 2024-11-26 07:01:28 +00:00
code style simplify
This commit is contained in:
parent
9d0798edc6
commit
f733b5707a
@ -145,12 +145,14 @@ func (c *JsonConfigContainer) getdata(key string) interface{} {
|
|||||||
}
|
}
|
||||||
sectionKey := strings.Split(key, "::")
|
sectionKey := strings.Split(key, "::")
|
||||||
if len(sectionKey) >= 2 {
|
if len(sectionKey) >= 2 {
|
||||||
if curValue, ok := c.data[sectionKey[0]]; ok {
|
curValue, ok := c.data[sectionKey[0]]
|
||||||
for _, key := range sectionKey[1:] {
|
if !ok {
|
||||||
if v, ok := curValue.(map[string]interface{}); ok {
|
return nil
|
||||||
if v2, ok := v[key]; ok {
|
}
|
||||||
return v2
|
for _, key := range sectionKey[1:] {
|
||||||
}
|
if v, ok := curValue.(map[string]interface{}); ok {
|
||||||
|
if v2, ok := v[key]; ok {
|
||||||
|
return v2
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user