(ctx context.Context, httpClient *http.Client, hostname string, assetURL safeurl.SafeURL)
| 209 | } |
| 210 | |
| 211 | func deleteAsset(ctx context.Context, httpClient *http.Client, hostname string, assetURL safeurl.SafeURL) error { |
| 212 | // The asset URL is supplied by the API, so it is absolute and requested as given. |
| 213 | // TODO(api-client-rollout) |
| 214 | // This line of code is part of a mechanical roll out of the api client. |
| 215 | // As a follow up, consider whether the api client can be injected to this call site, rather than constructed |
| 216 | resp, err := api.NewClientFromHTTP(httpClient).RequestWithContext(ctx, hostname, http.MethodDelete, assetURL.String(), nil) |
| 217 | if err != nil { |
| 218 | return err |
| 219 | } |
| 220 | defer resp.Body.Close() |
| 221 | |
| 222 | return nil |
| 223 | } |
no test coverage detected