(httpClient *http.Client, baseRepo ghrepo.Interface, tagName string)
| 140 | } |
| 141 | |
| 142 | func deleteTag(httpClient *http.Client, baseRepo ghrepo.Interface, tagName string) error { |
| 143 | path := fmt.Sprintf("repos/%s/%s/git/refs/tags/%s", baseRepo.RepoOwner(), baseRepo.RepoName(), tagName) |
| 144 | url := ghinstance.RESTPrefix(baseRepo.RepoHost()) + path |
| 145 | |
| 146 | req, err := http.NewRequest("DELETE", url, nil) |
| 147 | if err != nil { |
| 148 | return err |
| 149 | } |
| 150 | |
| 151 | resp, err := httpClient.Do(req) |
| 152 | if err != nil { |
| 153 | return err |
| 154 | } |
| 155 | defer resp.Body.Close() |
| 156 | |
| 157 | if resp.StatusCode > 299 { |
| 158 | return api.HandleHTTPError(resp) |
| 159 | } |
| 160 | return nil |
| 161 | } |
no test coverage detected