Support etcd

This commit is contained in:
Ming Deng
2020-08-26 03:46:22 +00:00
parent 5b35bf6065
commit c2361170b3
20 changed files with 581 additions and 257 deletions

View File

@@ -70,7 +70,8 @@ func TestYaml(t *testing.T) {
t.Fatal(err)
}
if yamlconf.String("appname") != "beeapi" {
res, _ := yamlconf.String("appname")
if res != "beeapi" {
t.Fatal("appname not equal to beeapi")
}
@@ -91,9 +92,9 @@ func TestYaml(t *testing.T) {
case bool:
value, err = yamlconf.Bool(k)
case []string:
value = yamlconf.Strings(k)
value, err = yamlconf.Strings(k)
case string:
value = yamlconf.String(k)
value, err = yamlconf.String(k)
default:
value, err = yamlconf.DIY(k)
}
@@ -108,7 +109,8 @@ func TestYaml(t *testing.T) {
if err = yamlconf.Set("name", "astaxie"); err != nil {
t.Fatal(err)
}
if yamlconf.String("name") != "astaxie" {
res, _ = yamlconf.String("name")
if res != "astaxie" {
t.Fatal("get name error")
}