Merge pull request #46845 from zhangxiaoyu-zidif/change-fatalf

Automatic merge from submit-queue

Use t.Fatalf instead

**What this PR does / why we need it**:
we can use t.Fatalf to take place of t.Errorf + t.FailNow()


**Release note**:

```release-note
NONE
```
This commit is contained in:
Kubernetes Submit Queue 2017-07-13 21:26:07 -07:00 committed by GitHub
commit 6d69f18f5b

View File

@ -296,14 +296,12 @@ func TestGenerateService(t *testing.T) {
body := objBody(codec, &test.service)
data, err := ioutil.ReadAll(req.Body)
if err != nil {
t.Errorf("unexpected error: %v", err)
t.FailNow()
t.Fatalf("unexpected error: %v", err)
}
defer req.Body.Close()
svc := &api.Service{}
if err := runtime.DecodeInto(codec, data, svc); err != nil {
t.Errorf("unexpected error: %v", err)
t.FailNow()
t.Fatalf("unexpected error: %v", err)
}
// Copy things that are defaulted by the system
test.service.Annotations = svc.Annotations