mirror of
https://github.com/StackExchange/dnscontrol.git
synced 2024-05-11 05:55:12 +00:00
CODE: Fix simple staticcheck items (#1329)
This commit is contained in:
@ -131,9 +131,7 @@ func (a *azurednsProvider) GetNameservers(domain string) ([]*models.Nameserver,
|
|||||||
|
|
||||||
var nss []string
|
var nss []string
|
||||||
if zone.ZoneProperties != nil {
|
if zone.ZoneProperties != nil {
|
||||||
for _, ns := range *zone.ZoneProperties.NameServers {
|
nss = append(nss, *zone.ZoneProperties.NameServers...)
|
||||||
nss = append(nss, ns)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return models.ToNameserversStripTD(nss)
|
return models.ToNameserversStripTD(nss)
|
||||||
}
|
}
|
||||||
|
@ -175,9 +175,6 @@ func (c *bindProvider) GetZoneRecords(domain string) (models.Records, error) {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
// FIXME(tlim): Empty branch? Is the intention to skip SOAs?
|
|
||||||
if rec.Type == "SOA" {
|
|
||||||
}
|
|
||||||
foundRecords = append(foundRecords, &rec)
|
foundRecords = append(foundRecords, &rec)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -135,7 +135,7 @@ func (g *gcloudProvider) GetNameservers(domain string) ([]*models.Nameserver, er
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
if zone == nil {
|
if zone == nil {
|
||||||
return nil, fmt.Errorf("Domain %q not found in your GCLOUD account", domain)
|
return nil, fmt.Errorf("domain %q not found in your GCLOUD account", domain)
|
||||||
}
|
}
|
||||||
return models.ToNameserversStripTD(zone.NameServers)
|
return models.ToNameserversStripTD(zone.NameServers)
|
||||||
}
|
}
|
||||||
|
@ -220,7 +220,7 @@ func (api *hetznerProvider) request(endpoint string, method string, request inte
|
|||||||
cleanupResponseBody := func() {
|
cleanupResponseBody := func() {
|
||||||
err := resp.Body.Close()
|
err := resp.Body.Close()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Println(fmt.Sprintf("failed closing response body: %q", err))
|
fmt.Printf("failed closing response body: %q\n", err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -521,10 +521,7 @@ func getZoneID(zone r53Types.HostedZone, r *models.RecordConfig) string {
|
|||||||
|
|
||||||
/** Removes "/hostedzone/"" prefix from AWS ZoneId */
|
/** Removes "/hostedzone/"" prefix from AWS ZoneId */
|
||||||
func parseZoneId(zoneID string) string {
|
func parseZoneId(zoneID string) string {
|
||||||
if strings.HasPrefix(zoneID, "/hostedzone/") {
|
return strings.TrimPrefix(zoneID, "/hostedzone/")
|
||||||
zoneID = strings.TrimPrefix(zoneID, "/hostedzone/")
|
|
||||||
}
|
|
||||||
return zoneID
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (r *route53Provider) GetRegistrarCorrections(dc *models.DomainConfig) ([]*models.Correction, error) {
|
func (r *route53Provider) GetRegistrarCorrections(dc *models.DomainConfig) ([]*models.Correction, error) {
|
||||||
|
@ -225,9 +225,7 @@ func toVultrRecord(dc *models.DomainConfig, rc *models.RecordConfig, vultrID int
|
|||||||
data := rc.GetTargetField()
|
data := rc.GetTargetField()
|
||||||
|
|
||||||
// Vultr does not use a period suffix for CNAME, NS, or MX.
|
// Vultr does not use a period suffix for CNAME, NS, or MX.
|
||||||
if strings.HasSuffix(data, ".") {
|
data = strings.TrimSuffix(data, ".")
|
||||||
data = data[:len(data)-1]
|
|
||||||
}
|
|
||||||
|
|
||||||
var priority *int
|
var priority *int
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user