Fix Sonart PR1

This commit is contained in:
Ming Deng
2021-02-01 00:18:34 +08:00
parent 326fc5dd9c
commit 41d682d878
11 changed files with 142 additions and 104 deletions

View File

@@ -54,7 +54,8 @@ func TestYaml(t *testing.T) {
"emptystrings": []string{},
}
)
f, err := os.Create("testyaml.conf")
cfgFileName := "testyaml.conf"
f, err := os.Create(cfgFileName)
if err != nil {
t.Fatal(err)
}
@@ -64,8 +65,8 @@ func TestYaml(t *testing.T) {
t.Fatal(err)
}
f.Close()
defer os.Remove("testyaml.conf")
yamlconf, err := config.NewConfig("yaml", "testyaml.conf")
defer os.Remove(cfgFileName)
yamlconf, err := config.NewConfig("yaml", cfgFileName)
if err != nil {
t.Fatal(err)
}