compareHTTPResponse returns whether two http.Response objects are equal or not. Currently, only StatusCode is checked. This function is used when implementing the Is(error) bool interface for the custom error types in this package.
(r1, r2 *http.Response)
| 1422 | // Currently, only StatusCode is checked. This function is used when implementing the |
| 1423 | // Is(error) bool interface for the custom error types in this package. |
| 1424 | func compareHTTPResponse(r1, r2 *http.Response) bool { |
| 1425 | if r1 == nil && r2 == nil { |
| 1426 | return true |
| 1427 | } |
| 1428 | |
| 1429 | if r1 != nil && r2 != nil { |
| 1430 | return r1.StatusCode == r2.StatusCode |
| 1431 | } |
| 1432 | return false |
| 1433 | } |
| 1434 | |
| 1435 | /* |
| 1436 | An ErrorResponse reports one or more errors caused by an API request. |
no outgoing calls
searching dependent graphs…