Fix a couple of lint and fmt issues.

This commit is contained in:
xenolf 2016-04-08 01:21:01 +02:00
parent 44d92633c6
commit 74c6bbee86
No known key found for this signature in database
GPG key ID: C9C13317912FAB20
4 changed files with 9 additions and 10 deletions

View file

@ -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
}

View file

@ -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)

View file

@ -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

View file

@ -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 {