refactor defer

pull/5258/head
Marcin Niemira 2019-09-17 20:21:39 +10:00
parent 77d69fefa4
commit 35f70a352f
No known key found for this signature in database
GPG Key ID: 5395D4A81A3FA475
1 changed files with 1 additions and 1 deletions

View File

@ -589,7 +589,7 @@ users:
mockK8sConfigByte := []byte(test.config)
mockK8sConfigPath := test.kubeconfigPath
err := ioutil.WriteFile(mockK8sConfigPath, mockK8sConfigByte, 0644)
defer func() { os.Remove(mockK8sConfigPath) }()
defer os.Remove(mockK8sConfigPath)
if err != nil {
t.Fatalf("Unexpected error when writing to file %v. Error: %v", test.kubeconfigPath, err)
}