code style simplify
Showing
1 changed file
with
8 additions
and
6 deletions
| ... | @@ -145,12 +145,14 @@ func (c *JsonConfigContainer) getdata(key string) interface{} { | ... | @@ -145,12 +145,14 @@ func (c *JsonConfigContainer) getdata(key string) interface{} { |
| 145 | } | 145 | } |
| 146 | sectionKey := strings.Split(key, "::") | 146 | sectionKey := strings.Split(key, "::") |
| 147 | if len(sectionKey) >= 2 { | 147 | if len(sectionKey) >= 2 { |
| 148 | if curValue, ok := c.data[sectionKey[0]]; ok { | 148 | curValue, ok := c.data[sectionKey[0]] |
| 149 | for _, key := range sectionKey[1:] { | 149 | if !ok { |
| 150 | if v, ok := curValue.(map[string]interface{}); ok { | 150 | return nil |
| 151 | if v2, ok := v[key]; ok { | 151 | } |
| 152 | return v2 | 152 | for _, key := range sectionKey[1:] { |
| 153 | } | 153 | if v, ok := curValue.(map[string]interface{}); ok { |
| 154 | if v2, ok := v[key]; ok { | ||
| 155 | return v2 | ||
| 154 | } | 156 | } |
| 155 | } | 157 | } |
| 156 | } | 158 | } | ... | ... |
-
Please register or sign in to post a comment