mirror of
https://github.com/astaxie/beego.git
synced 2024-11-25 07:30:55 +00:00
config ini module when set section is not exist will panic!
This commit is contained in:
parent
cfcfeb7b99
commit
d0e2c5c67a
@ -162,6 +162,9 @@ func (c *IniConfigContainer) Set(key, value string) error {
|
|||||||
section = DEFAULT_SECTION
|
section = DEFAULT_SECTION
|
||||||
k = sectionkey[0]
|
k = sectionkey[0]
|
||||||
}
|
}
|
||||||
|
if _, ok := c.data[section]; !ok {
|
||||||
|
c.data[section] = make(map[string]string)
|
||||||
|
}
|
||||||
c.data[section][k] = value
|
c.data[section][k] = value
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user