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

Function deleteAsset

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

Source from the content-addressed store, hash-verified

209}
210
211func 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}

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