mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-31 07:20:13 +00:00
the created path should be closed in test case
This commit is contained in:
parent
8d00825481
commit
f8a86e4c96
@ -93,6 +93,7 @@ func write(path, contents string, t *testing.T) {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatalf("Failed to create %v.", path)
|
t.Fatalf("Failed to create %v.", path)
|
||||||
}
|
}
|
||||||
|
defer f.Close()
|
||||||
_, err = f.WriteString(contents)
|
_, err = f.WriteString(contents)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatalf("Failed to write to %v.", path)
|
t.Fatalf("Failed to write to %v.", path)
|
||||||
|
Loading…
Reference in New Issue
Block a user