1
0
mirror of https://github.com/StackExchange/dnscontrol.git synced 2024-05-11 05:55:12 +00:00

CHORE: Satisfy Staticcheck and remove unused code (#2331)

This commit is contained in:
Daniil Lemenkov
2023-05-08 23:49:26 +03:00
committed by GitHub
parent f7118574a9
commit 36e3595612
17 changed files with 43 additions and 109 deletions

View File

@@ -260,13 +260,15 @@ func (c *desecProvider) upsertRR(rr []resourceRecord, domain string) error {
return nil
}
func (c *desecProvider) deleteRR(domain, shortname, t string) error {
endpoint := fmt.Sprintf("/domains/%s/rrsets/%s/%s/", domain, shortname, t)
if _, _, err := c.get(endpoint, "DELETE"); err != nil {
return fmt.Errorf("failed delete RRset (deSEC): %v", err)
}
return nil
}
// Uncomment this function in case of using it
// It was commented out to satisfy `staticcheck` warnings about unused code
//func (c *desecProvider) deleteRR(domain, shortname, t string) error {
// endpoint := fmt.Sprintf("/domains/%s/rrsets/%s/%s/", domain, shortname, t)
// if _, _, err := c.get(endpoint, "DELETE"); err != nil {
// return fmt.Errorf("failed delete RRset (deSEC): %v", err)
// }
// return nil
//}
func (c *desecProvider) get(target, method string) ([]byte, *http.Response, error) {
retrycnt := 0