(result *response, data interface{})
| 135 | } |
| 136 | |
| 137 | func parseResponseBody(result *response, data interface{}) error { |
| 138 | // At this point we know the API call succeeded, so, parse out the inner |
| 139 | // result into the datatype provided as a parameter. |
| 140 | if err := json.Unmarshal(result.Result, &data); err != nil { |
| 141 | return errors.Wrap(err, "the Cloudflare API response was an unexpected type") |
| 142 | } |
| 143 | return nil |
| 144 | } |
| 145 | |
| 146 | func fetchExhaustively[T any](requestFn func(int) (*http.Response, error)) ([]*T, error) { |
| 147 | page := 0 |
no test coverage detected