MCPcopy
hub / github.com/cli/cli / deleteGist

Function deleteGist

pkg/cmd/gist/delete/delete.go:144–155  ·  view source on GitHub ↗
(apiClient *api.Client, hostname string, gistID string)

Source from the content-addressed store, hash-verified

142}
143
144func deleteGist(apiClient *api.Client, hostname string, gistID string) error {
145 path := "gists/" + gistID
146 err := apiClient.REST(hostname, "DELETE", path, nil, nil)
147 if err != nil {
148 var httpErr api.HTTPError
149 if errors.As(err, &httpErr) && httpErr.StatusCode == 404 {
150 return shared.NotFoundErr
151 }
152 return err
153 }
154 return nil
155}

Callers 2

deleteRunFunction · 0.85
Test_gistDeleteFunction · 0.85

Calls 1

RESTMethod · 0.65

Tested by 1

Test_gistDeleteFunction · 0.68