Skip to content

Commit

Permalink
Prevent panic in during when error was expected but it's nil
Browse files Browse the repository at this point in the history
  • Loading branch information
waltton committed Jun 5, 2021
1 parent 437b44a commit dcd9b70
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion http_backend_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ func TestHTTPBackendDoCancelation(t *testing.T) {
t.Errorf("no error was expected for the first %d responses; error: %q", n, err)
}
} else {
if !strings.Contains(err.Error(), "context canceled") {
if err == nil || !strings.Contains(err.Error(), "context canceled") {
t.Error("call to Do should return with error from terminated context")
}
}
Expand Down

0 comments on commit dcd9b70

Please sign in to comment.