MCPcopy Index your code
hub / github.com/google/go-github / compareHTTPResponse

Function compareHTTPResponse

github/github.go:1424–1433  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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.
1424func 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/*
1436An ErrorResponse reports one or more errors caused by an API request.

Callers 4

IsMethod · 0.85
IsMethod · 0.85
IsMethod · 0.85
TestCompareHttpResponseFunction · 0.85

Calls

no outgoing calls

Tested by 1

TestCompareHttpResponseFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…