mirror of
https://github.com/astaxie/beego.git
synced 2025-06-12 07:10:39 +00:00
config ini module when set section is not exist will panic!
This commit is contained in:
@ -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
|
||||
}
|
||||
|
Reference in New Issue
Block a user