Skip to content

Commit

Permalink
Simplify mustGet function
Browse files Browse the repository at this point in the history
  • Loading branch information
magiconair committed Apr 19, 2017
1 parent 981159a commit 993e448
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions proxy/http_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -387,16 +387,11 @@ func mustDo(req *http.Request) (*http.Response, []byte) {
}

func mustGet(urlstr string) (*http.Response, []byte) {
resp, err := http.DefaultClient.Get(urlstr)
req, err := http.NewRequest("GET", urlstr, nil)
if err != nil {
panic(err)
}
defer resp.Body.Close()
body, err := ioutil.ReadAll(resp.Body)
if err != nil {
panic(err)
}
return resp, body
return mustDo(req)
}

// compress returns the gzip compressed content of b.
Expand Down

0 comments on commit 993e448

Please sign in to comment.