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:
@ -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.
|
||||
|
Reference in New Issue
Block a user