code style simplify
Showing
1 changed file
with
4 additions
and
2 deletions
| ... | @@ -145,7 +145,10 @@ func (c *JsonConfigContainer) getdata(key string) interface{} { | ... | @@ -145,7 +145,10 @@ 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 | if !ok { | ||
| 150 | return nil | ||
| 151 | } | ||
| 149 | for _, key := range sectionKey[1:] { | 152 | for _, key := range sectionKey[1:] { |
| 150 | if v, ok := curValue.(map[string]interface{}); ok { | 153 | if v, ok := curValue.(map[string]interface{}); ok { |
| 151 | if v2, ok := v[key]; ok { | 154 | if v2, ok := v[key]; ok { |
| ... | @@ -153,7 +156,6 @@ func (c *JsonConfigContainer) getdata(key string) interface{} { | ... | @@ -153,7 +156,6 @@ func (c *JsonConfigContainer) getdata(key string) interface{} { |
| 153 | } | 156 | } |
| 154 | } | 157 | } |
| 155 | } | 158 | } |
| 156 | } | ||
| 157 | return nil | 159 | return nil |
| 158 | } | 160 | } |
| 159 | if v, ok := c.data[key]; ok { | 161 | if v, ok := c.data[key]; ok { | ... | ... |
-
Please register or sign in to post a comment