Return nil not empty []string{}

Return nil if config value does not exist or is empty
This commit is contained in:
ysqi
2016-03-03 20:03:23 +08:00
parent 8ff74e71cb
commit 19d921d3f5
7 changed files with 17 additions and 12 deletions

View File

@@ -80,7 +80,7 @@ func TestYaml(t *testing.T) {
t.Fatal("get name error")
}
if len(yamlconf.Strings("emptystrings")) != 0 {
if yamlconf.Strings("emptystrings") != nil {
t.Fatal("get emtpy strings error")
}
}