Skip to content

Commit

Permalink
delete minor unreachable code caused by log.Fatal
Browse files Browse the repository at this point in the history
Signed-off-by: Abirdcfly <[email protected]>
  • Loading branch information
Abirdcfly authored Aug 10, 2022
1 parent 337f08a commit 79ec3b5
Showing 1 changed file with 0 additions and 8 deletions.
8 changes: 0 additions & 8 deletions netutil/http_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ func TestHttpGet(t *testing.T) {
resp, err := HttpGet(url, header)
if err != nil {
log.Fatal(err)
t.FailNow()
}

body, _ := ioutil.ReadAll(resp.Body)
Expand All @@ -40,7 +39,6 @@ func TestHttpPost(t *testing.T) {
resp, err := HttpPost(url, header, nil, bodyParams)
if err != nil {
log.Fatal(err)
t.FailNow()
}
body, _ := ioutil.ReadAll(resp.Body)
t.Log("response: ", resp.StatusCode, string(body))
Expand All @@ -67,7 +65,6 @@ func TestHttpPostFormData(t *testing.T) {
resp, err := HttpPost(apiUrl, header, postData, nil)
if err != nil {
log.Fatal(err)
t.FailNow()
}
body, _ := ioutil.ReadAll(resp.Body)
t.Log("response: ", resp.StatusCode, string(body))
Expand All @@ -89,7 +86,6 @@ func TestHttpPut(t *testing.T) {
resp, err := HttpPut(url, header, nil, bodyParams)
if err != nil {
log.Fatal(err)
t.FailNow()
}
body, _ := ioutil.ReadAll(resp.Body)
t.Log("response: ", resp.StatusCode, string(body))
Expand All @@ -111,7 +107,6 @@ func TestHttpPatch(t *testing.T) {
resp, err := HttpPatch(url, header, nil, bodyParams)
if err != nil {
log.Fatal(err)
t.FailNow()
}
body, _ := ioutil.ReadAll(resp.Body)
t.Log("response: ", resp.StatusCode, string(body))
Expand All @@ -122,7 +117,6 @@ func TestHttpDelete(t *testing.T) {
resp, err := HttpDelete(url)
if err != nil {
log.Fatal(err)
t.FailNow()
}
body, _ := ioutil.ReadAll(resp.Body)
t.Log("response: ", resp.StatusCode, string(body))
Expand All @@ -148,7 +142,6 @@ func TestParseResponse(t *testing.T) {
resp, err := HttpGet(url, header)
if err != nil {
log.Fatal(err)
t.FailNow()
}

type Todo struct {
Expand All @@ -162,7 +155,6 @@ func TestParseResponse(t *testing.T) {
err = ParseHttpResponse(resp, toDoResp)
if err != nil {
log.Fatal(err)
t.FailNow()
}
t.Log("response: ", toDoResp)
}

0 comments on commit 79ec3b5

Please sign in to comment.