1
0
mirror of https://github.com/astaxie/beego.git synced 2025-07-01 05:10:17 +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

@ -25,6 +25,10 @@ func (c *fakeConfigContainer) String(key string) string {
return c.getData(key)
}
func (c *fakeConfigContainer) Strings(key string) []string {
return strings.Split(c.getData(key), ";")
}
func (c *fakeConfigContainer) Int(key string) (int, error) {
return strconv.Atoi(c.getData(key))
}