1
0
mirror of https://github.com/astaxie/beego.git synced 2025-07-07 02:40: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

@ -19,6 +19,7 @@ copyrequestbody = true
key1="asta"
key2 = "xie"
CaseInsensitive = true
peers = one;two;three
`
func TestIni(t *testing.T) {
@ -78,4 +79,11 @@ func TestIni(t *testing.T) {
if v, err := iniconf.Bool("demo::caseinsensitive"); err != nil || v != true {
t.Fatal("get demo.caseinsensitive error")
}
if data := iniconf.Strings("demo::peers"); len(data) != 3 {
t.Fatal("get strings error", data)
} else if data[0] != "one" {
t.Fatal("get first params error not equat to one")
}
}