MCPcopy Create free account
hub / github.com/cli/cli / deleteAsset

Function deleteAsset

pkg/cmd/release/shared/upload.go:210–222  ·  view source on GitHub ↗
(ctx context.Context, httpClient *http.Client, hostname string, assetURL safeurl.SafeURL)

Source from the content-addressed store, hash-verified

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

Callers 1

uploadWithDeleteFunction · 0.70

Calls 4

NewClientFromHTTPFunction · 0.92
RequestWithContextMethod · 0.80
StringMethod · 0.65
CloseMethod · 0.65

Tested by

no test coverage detected