1
0
mirror of https://github.com/astaxie/beego.git synced 2024-06-24 13:24:14 +00:00

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

This commit is contained in:
astaxie 2013-12-24 21:57:15 +08:00
parent cfcfeb7b99
commit d0e2c5c67a

View File

@ -162,6 +162,9 @@ func (c *IniConfigContainer) Set(key, value string) error {
section = DEFAULT_SECTION
k = sectionkey[0]
}
if _, ok := c.data[section]; !ok {
c.data[section] = make(map[string]string)
}
c.data[section][k] = value
return nil
}