Skip to content

Commit

Permalink
avoid nil resp when there is an error (#74)
Browse files Browse the repository at this point in the history
  • Loading branch information
trapacska authored May 26, 2021
1 parent 07be2c7 commit 9331d16
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ func main() {

client := &http.Client{}
resp, err := client.Do(req)
if resp.StatusCode != http.StatusOK || err != nil {
if err != nil || resp.StatusCode != http.StatusOK {
resp, err = client.Do(req)
if err != nil {
failf("Failed to get http response, error: %s", err)
Expand Down

0 comments on commit 9331d16

Please sign in to comment.