mirror of
https://github.com/astaxie/beego.git
synced 2025-07-06 02:10:18 +00:00
add Strings interface can return []string sep by ;
Example: peers = one;Two;Three
This commit is contained in:
@ -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()
|
||||
|
Reference in New Issue
Block a user