the created path should be closed in test case

This commit is contained in:
guangxuli 2016-09-06 11:08:52 +08:00
parent 8d00825481
commit f8a86e4c96

View File

@ -93,6 +93,7 @@ func write(path, contents string, t *testing.T) {
if err != nil {
t.Fatalf("Failed to create %v.", path)
}
defer f.Close()
_, err = f.WriteString(contents)
if err != nil {
t.Fatalf("Failed to write to %v.", path)