I'm not sure what the rationale for this was, but issuing a nil error while swallowing the actual error is non-standard Go practice, which in our case led to some unexpected results since we validated that err != nil. This function should instead issue a specific error for 404's and reference it with errors.Is.
|
if resp.StatusCode == http.StatusNotFound { |
|
return nil, nil |
|
} |