1
0
mirror of https://github.com/astaxie/beego.git synced 2025-07-06 04:20:19 +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

@ -116,6 +116,11 @@ func (c *JsonConfigContainer) String(key string) string {
return ""
}
// Strings returns the []string value for a given key.
func (c *JsonConfigContainer) Strings(key string) []string {
return strings.Split(c.String(key), ";")
}
// WriteValue writes a new value for key.
func (c *JsonConfigContainer) Set(key, val string) error {
c.Lock()