Merge pull request #59035 from YuxiJin-tobeyjin/fix-format-error-for-sioUtil-ut

Automatic merge from submit-queue (batch tested with PRs 59035, 61933). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Fix format error for sioUtil-UT

**What this PR does / why we need it**:
1、Use t.Fatalf instead of t.Fatal when format is needed;
2、Before my change, when open file failed you will get such return "failed to open conf file: %!(EXTRA os.file=&{***})". After my change, when open file failed you will get such return "Failed to open conf file: /dir/filename",which is more human readable .

**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Fixes #

**Special notes for your reviewer**:

**Release note**:

```release-note
 "NONE"
```
This commit is contained in:
Kubernetes Submit Queue 2018-04-09 06:56:05 -07:00 committed by GitHub
commit 436f1cd748
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -159,11 +159,11 @@ func TestUtilSaveConfig(t *testing.T) {
confKey.sslEnabled: "false",
}
if err := saveConfig(config, data); err != nil {
t.Fatal("failed while saving data", err)
t.Fatalf("failed while saving data: %v", err)
}
file, err := os.Open(config)
if err != nil {
t.Fatal("failed to open conf file: ", file)
t.Fatalf("failed to open conf file %s: %v", config, err)
}
defer file.Close()
dataRcvd := map[string]string{}