d0e2c5c6 by astaxie

config ini module when set section is not exist will panic!

1 parent cfcfeb7b
...@@ -162,6 +162,9 @@ func (c *IniConfigContainer) Set(key, value string) error { ...@@ -162,6 +162,9 @@ func (c *IniConfigContainer) Set(key, value string) error {
162 section = DEFAULT_SECTION 162 section = DEFAULT_SECTION
163 k = sectionkey[0] 163 k = sectionkey[0]
164 } 164 }
165 if _, ok := c.data[section]; !ok {
166 c.data[section] = make(map[string]string)
167 }
165 c.data[section][k] = value 168 c.data[section][k] = value
166 return nil 169 return nil
167 } 170 }
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!