Fix a few golint errors.

This commit is contained in:
xenolf 2016-03-19 17:53:16 +01:00
parent d6fb247c29
commit 4562a14383
3 changed files with 7 additions and 5 deletions

View file

@ -107,6 +107,8 @@ func (c *DNSProvider) CleanUp(domain, token, keyAuth string) error {
return nil
}
// Timeout customizes the timeout values used by the ACME package for checking
// DNS record validity.
func (c *DNSProvider) Timeout() (timeout, interval time.Duration) {
return 180 * time.Second, 5 * time.Second
}

View file

@ -31,7 +31,7 @@ import (
var (
debug = false
defaultBaseURL = "https://api.namecheap.com/xml.response"
getIpURL = "https://dynamicdns.park-your-domain.com/getip"
getIPURL = "https://dynamicdns.park-your-domain.com/getip"
httpClient = http.Client{Timeout: 60 * time.Second}
)
@ -68,7 +68,7 @@ func NewDNSProvider(apiUser, apiKey string) (*DNSProvider, error) {
}, nil
}
// Namecheap can sometimes take a long time to complete an update, so wait
// Timeout : Namecheap can sometimes take a long time to complete an update, so wait
// up to 60 minutes for the update to propagate.
func (d *DNSProvider) Timeout() (timeout, interval time.Duration) {
return 60 * time.Minute, 15 * time.Second
@ -94,7 +94,7 @@ type apierror struct {
// getClientIP returns the client's public IP address. It uses namecheap's
// IP discovery service to perform the lookup.
func getClientIP() (addr string, err error) {
resp, err := httpClient.Get(getIpURL)
resp, err := httpClient.Get(getIPURL)
if err != nil {
return "", err
}

View file

@ -271,7 +271,7 @@ type testcase struct {
setHostsResponse string
}
var testcases []testcase = []testcase{
var testcases = []testcase{
{
"Test:Success:1",
"test.example.com",
@ -374,7 +374,7 @@ var responseSetHostsSuccess2 = `<?xml version="1.0" encoding="utf-8"?>
<ExecutionTime>2.347</ExecutionTime>
</ApiResponse>`
var responseGetHostsErrorBadApiKey1 = `<?xml version="1.0" encoding="utf-8"?>
var responseGetHostsErrorBadAPIKey1 = `<?xml version="1.0" encoding="utf-8"?>
<ApiResponse Status="ERROR" xmlns="http://api.namecheap.com/xml.response">
<Errors>
<Error Number="1011102">API Key is invalid or API access has not been enabled</Error>