1
0
mirror of https://github.com/astaxie/beego.git synced 2024-11-26 07:11:29 +00:00

code style simplify

This commit is contained in:
fuxiaohei 2014-07-17 15:49:40 +08:00
parent 9d0798edc6
commit f733b5707a

View File

@ -145,7 +145,10 @@ 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]]
if !ok {
return nil
}
for _, key := range sectionKey[1:] { for _, key := range sectionKey[1:] {
if v, ok := curValue.(map[string]interface{}); ok { if v, ok := curValue.(map[string]interface{}); ok {
if v2, ok := v[key]; ok { if v2, ok := v[key]; ok {
@ -153,7 +156,6 @@ func (c *JsonConfigContainer) getdata(key string) interface{} {
} }
} }
} }
}
return nil return nil
} }
if v, ok := c.data[key]; ok { if v, ok := c.data[key]; ok {