client: fix from go vet, go lint

This commit is contained in:
Gyu-Ho Lee 2016-06-22 12:01:24 -07:00
parent 6557ef7cd8
commit e2138179e3

View File

@ -645,15 +645,14 @@ func assertRequest(got http.Request, wantMethod string, wantURL *url.URL, wantHe
} else {
if wantBody == nil {
return fmt.Errorf("want.Body=%v got.Body=%s", wantBody, got.Body)
} else {
gotBytes, err := ioutil.ReadAll(got.Body)
if err != nil {
return err
}
}
gotBytes, err := ioutil.ReadAll(got.Body)
if err != nil {
return err
}
if !reflect.DeepEqual(wantBody, gotBytes) {
return fmt.Errorf("want.Body=%s got.Body=%s", wantBody, gotBytes)
}
if !reflect.DeepEqual(wantBody, gotBytes) {
return fmt.Errorf("want.Body=%s got.Body=%s", wantBody, gotBytes)
}
}