Commit f733b570 authored by fuxiaohei's avatar fuxiaohei

code style simplify

parent 9d0798ed
...@@ -145,12 +145,14 @@ func (c *JsonConfigContainer) getdata(key string) interface{} { ...@@ -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
} }
} }
} }
......
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