From 74c6bbee866483cf8267ef162c0abb3139a9f927 Mon Sep 17 00:00:00 2001 From: xenolf Date: Fri, 8 Apr 2016 01:21:01 +0200 Subject: [PATCH] Fix a couple of lint and fmt issues. --- providers/dns/cloudflare/cloudflare.go | 2 +- providers/dns/digitalocean/digitalocean.go | 4 ++-- providers/dns/dnsimple/dnsimple.go | 1 - providers/dns/route53/route53.go | 12 ++++++------ 4 files changed, 9 insertions(+), 10 deletions(-) diff --git a/providers/dns/cloudflare/cloudflare.go b/providers/dns/cloudflare/cloudflare.go index 20af8732..db8607e4 100644 --- a/providers/dns/cloudflare/cloudflare.go +++ b/providers/dns/cloudflare/cloudflare.go @@ -109,7 +109,7 @@ func (c *DNSProvider) getHostedZoneID(fqdn string) (string, error) { return "", err } - result, err := c.makeRequest("GET", "/zones?name=" + acme.UnFqdn(authZone), nil) + result, err := c.makeRequest("GET", "/zones?name="+acme.UnFqdn(authZone), nil) if err != nil { return "", err } diff --git a/providers/dns/digitalocean/digitalocean.go b/providers/dns/digitalocean/digitalocean.go index 9f744f38..91880636 100644 --- a/providers/dns/digitalocean/digitalocean.go +++ b/providers/dns/digitalocean/digitalocean.go @@ -66,7 +66,7 @@ func (d *DNSProvider) Present(domain, token, keyAuth string) error { authZone, err := acme.FindZoneByFqdn(acme.ToFqdn(domain), acme.RecursiveNameserver) if err != nil { return fmt.Errorf("Could not determine zone for domain: '%s'. %s", domain, err) - } + } authZone = acme.UnFqdn(authZone) @@ -125,7 +125,7 @@ func (d *DNSProvider) CleanUp(domain, token, keyAuth string) error { authZone, err := acme.FindZoneByFqdn(acme.ToFqdn(domain), acme.RecursiveNameserver) if err != nil { return fmt.Errorf("Could not determine zone for domain: '%s'. %s", domain, err) - } + } authZone = acme.UnFqdn(authZone) diff --git a/providers/dns/dnsimple/dnsimple.go b/providers/dns/dnsimple/dnsimple.go index c58c91eb..e9f116fb 100644 --- a/providers/dns/dnsimple/dnsimple.go +++ b/providers/dns/dnsimple/dnsimple.go @@ -79,7 +79,6 @@ func (c *DNSProvider) getHostedZone(domain string) (string, string, error) { return "", "", fmt.Errorf("DNSimple API call failed: %v", err) } - authZone, err := acme.FindZoneByFqdn(domain, acme.RecursiveNameserver) if err != nil { return "", "", err diff --git a/providers/dns/route53/route53.go b/providers/dns/route53/route53.go index 47b56176..8d1ff7c8 100644 --- a/providers/dns/route53/route53.go +++ b/providers/dns/route53/route53.go @@ -106,11 +106,11 @@ func (r *DNSProvider) changeRecord(action, fqdn, value string, ttl int) error { return err } - statusId := resp.ChangeInfo.Id + statusID := resp.ChangeInfo.Id return acme.WaitFor(120*time.Second, 4*time.Second, func() (bool, error) { reqParams := &route53.GetChangeInput{ - Id: statusId, + Id: statusID, } resp, err := r.client.GetChange(reqParams) if err != nil { @@ -144,12 +144,12 @@ func (r *DNSProvider) getHostedZoneID(fqdn string) (string, error) { return "", fmt.Errorf("Zone %s not found in Route53 for domain %s", authZone, fqdn) } - zoneId := *resp.HostedZones[0].Id - if strings.HasPrefix(zoneId, "/hostedzone/") { - zoneId = strings.TrimPrefix(zoneId, "/hostedzone/") + zoneID := *resp.HostedZones[0].Id + if strings.HasPrefix(zoneID, "/hostedzone/") { + zoneID = strings.TrimPrefix(zoneID, "/hostedzone/") } - return zoneId, nil + return zoneID, nil } func newTXTRecordSet(fqdn, value string, ttl int) *route53.ResourceRecordSet {