(httpClient *http.Client, host, id string)
| 16 | } |
| 17 | |
| 18 | func deleteGPGKey(httpClient *http.Client, host, id string) error { |
| 19 | url := fmt.Sprintf("%suser/gpg_keys/%s", ghinstance.RESTPrefix(host), id) |
| 20 | req, err := http.NewRequest("DELETE", url, nil) |
| 21 | if err != nil { |
| 22 | return err |
| 23 | } |
| 24 | |
| 25 | resp, err := httpClient.Do(req) |
| 26 | if err != nil { |
| 27 | return err |
| 28 | } |
| 29 | defer resp.Body.Close() |
| 30 | |
| 31 | if resp.StatusCode > 299 { |
| 32 | return api.HandleHTTPError(resp) |
| 33 | } |
| 34 | |
| 35 | return nil |
| 36 | } |
| 37 | |
| 38 | func getGPGKeys(httpClient *http.Client, host string) ([]gpgKey, error) { |
| 39 | resource := "user/gpg_keys" |
no test coverage detected