1
0
mirror of https://github.com/astaxie/beego.git synced 2025-07-03 18:20:18 +00:00

add Strings interface can return []string sep by ;

Example:
peers = one;Two;Three
This commit is contained in:
astaxie
2014-01-15 17:19:03 +08:00
parent b016102d34
commit fee3c2b8f9
7 changed files with 37 additions and 2 deletions

View File

@ -146,6 +146,11 @@ func (c *IniConfigContainer) String(key string) string {
return c.getdata(key)
}
// Strings returns the []string value for a given key.
func (c *IniConfigContainer) Strings(key string) []string {
return strings.Split(c.String(key), ";")
}
// WriteValue writes a new value for key.
// if write to one section, the key need be "section::key".
// if the section is not existed, it panics.