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

Function deleteGist

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

Source from the content-addressed store, hash-verified

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

Callers 2

deleteRunFunction · 0.85
Test_gistDeleteFunction · 0.85

Calls 3

JoinPathFunction · 0.92
RESTMethod · 0.65
StringMethod · 0.65

Tested by 1

Test_gistDeleteFunction · 0.68