Use t.Fatalf instead

This commit is contained in:
zhangxiaoyu-zidif
2017-06-02 17:35:33 +08:00
parent 7043372d05
commit 02af4b31a6

View File

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