From b62e1f9352c069161a41032f1f12b5a796ea3b61 Mon Sep 17 00:00:00 2001 From: Ludovic Fernandez Date: Sun, 9 Aug 2020 16:39:44 +0200 Subject: [PATCH] chore: update linter. (#1228) --- .golangci.toml | 1 + certificate/authorization.go | 2 +- challenge/challenges.go | 4 ++-- challenge/dns01/dns_challenge.go | 6 +++--- lego/client_config.go | 4 ++-- providers/dns/conoha/internal/client_test.go | 3 +-- providers/dns/gandi/gandi.go | 2 +- providers/dns/netcup/internal/client_test.go | 3 +-- providers/dns/netcup/netcup.go | 3 +-- providers/dns/nifcloud/internal/client.go | 2 +- providers/dns/nifcloud/nifcloud.go | 3 +-- 11 files changed, 15 insertions(+), 18 deletions(-) diff --git a/.golangci.toml b/.golangci.toml index c03ee42d..54f8430c 100644 --- a/.golangci.toml +++ b/.golangci.toml @@ -38,6 +38,7 @@ "nestif", # too many false-positive "goerr113", # not relevant "noctx", + "nlreturn", ] [issues] diff --git a/certificate/authorization.go b/certificate/authorization.go index f93413f0..aa231c45 100644 --- a/certificate/authorization.go +++ b/certificate/authorization.go @@ -11,7 +11,7 @@ const ( // overallRequestLimit is the overall number of request per second // limited on the "new-reg", "new-authz" and "new-cert" endpoints. // From the documentation the limitation is 20 requests per second, - // but using 20 as value doesn't work but 18 do + // but using 20 as value doesn't work but 18 do. overallRequestLimit = 18 ) diff --git a/challenge/challenges.go b/challenge/challenges.go index f1cac006..5d4db6ec 100644 --- a/challenge/challenges.go +++ b/challenge/challenges.go @@ -11,11 +11,11 @@ type Type string const ( // HTTP01 is the "http-01" ACME challenge https://tools.ietf.org/html/rfc8555#section-8.3 - // Note: ChallengePath returns the URL path to fulfill this challenge + // Note: ChallengePath returns the URL path to fulfill this challenge. HTTP01 = Type("http-01") // DNS01 is the "dns-01" ACME challenge https://tools.ietf.org/html/rfc8555#section-8.4 - // Note: GetRecord returns a DNS record which will fulfill this challenge + // Note: GetRecord returns a DNS record which will fulfill this challenge. DNS01 = Type("dns-01") // TLSALPN01 is the "tls-alpn-01" ACME challenge https://tools.ietf.org/html/draft-ietf-acme-tls-alpn-07 diff --git a/challenge/dns01/dns_challenge.go b/challenge/dns01/dns_challenge.go index da468c7d..f3880c77 100644 --- a/challenge/dns01/dns_challenge.go +++ b/challenge/dns01/dns_challenge.go @@ -17,13 +17,13 @@ import ( ) const ( - // DefaultPropagationTimeout default propagation timeout + // DefaultPropagationTimeout default propagation timeout. DefaultPropagationTimeout = 60 * time.Second - // DefaultPollingInterval default polling interval + // DefaultPollingInterval default polling interval. DefaultPollingInterval = 2 * time.Second - // DefaultTTL default TTL + // DefaultTTL default TTL. DefaultTTL = 120 ) diff --git a/lego/client_config.go b/lego/client_config.go index 49e3a8b8..ede46d9e 100644 --- a/lego/client_config.go +++ b/lego/client_config.go @@ -27,10 +27,10 @@ const ( // the system-wide trusted root list. caServerNameEnvVar = "LEGO_CA_SERVER_NAME" - // LEDirectoryProduction URL to the Let's Encrypt production + // LEDirectoryProduction URL to the Let's Encrypt production. LEDirectoryProduction = "https://acme-v02.api.letsencrypt.org/directory" - // LEDirectoryStaging URL to the Let's Encrypt staging + // LEDirectoryStaging URL to the Let's Encrypt staging. LEDirectoryStaging = "https://acme-staging-v02.api.letsencrypt.org/directory" ) diff --git a/providers/dns/conoha/internal/client_test.go b/providers/dns/conoha/internal/client_test.go index 899d96c4..cee3580f 100644 --- a/providers/dns/conoha/internal/client_test.go +++ b/providers/dns/conoha/internal/client_test.go @@ -8,9 +8,8 @@ import ( "testing" "time" - "github.com/stretchr/testify/require" - "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" ) func setupClientTest() (*http.ServeMux, *Client, func()) { diff --git a/providers/dns/gandi/gandi.go b/providers/dns/gandi/gandi.go index 97ff029c..585eb7bb 100644 --- a/providers/dns/gandi/gandi.go +++ b/providers/dns/gandi/gandi.go @@ -17,7 +17,7 @@ import ( // Gandi API domain examples: http://doc.rpc.gandi.net/domain/faq.html const ( - // defaultBaseURL Gandi XML-RPC endpoint used by Present and CleanUp + // defaultBaseURL Gandi XML-RPC endpoint used by Present and CleanUp. defaultBaseURL = "https://rpc.gandi.net/xmlrpc/" minTTL = 300 ) diff --git a/providers/dns/netcup/internal/client_test.go b/providers/dns/netcup/internal/client_test.go index a8689f11..eef1c1d9 100644 --- a/providers/dns/netcup/internal/client_test.go +++ b/providers/dns/netcup/internal/client_test.go @@ -9,9 +9,8 @@ import ( "strings" "testing" - "github.com/go-acme/lego/v3/platform/tester" - "github.com/go-acme/lego/v3/challenge/dns01" + "github.com/go-acme/lego/v3/platform/tester" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) diff --git a/providers/dns/netcup/netcup.go b/providers/dns/netcup/netcup.go index f17a2010..f4416dc8 100644 --- a/providers/dns/netcup/netcup.go +++ b/providers/dns/netcup/netcup.go @@ -8,11 +8,10 @@ import ( "strings" "time" - "github.com/go-acme/lego/v3/providers/dns/netcup/internal" - "github.com/go-acme/lego/v3/challenge/dns01" "github.com/go-acme/lego/v3/log" "github.com/go-acme/lego/v3/platform/config/env" + "github.com/go-acme/lego/v3/providers/dns/netcup/internal" ) // Environment variables names. diff --git a/providers/dns/nifcloud/internal/client.go b/providers/dns/nifcloud/internal/client.go index e4585661..c9f9cb7d 100644 --- a/providers/dns/nifcloud/internal/client.go +++ b/providers/dns/nifcloud/internal/client.go @@ -15,7 +15,7 @@ import ( const ( defaultBaseURL = "https://dns.api.nifcloud.com" apiVersion = "2012-12-12N2013-12-16" - // XMLNs XML NS of Route53 + // XMLNs XML NS of Route53. XMLNs = "https://route53.amazonaws.com/doc/2012-12-12/" ) diff --git a/providers/dns/nifcloud/nifcloud.go b/providers/dns/nifcloud/nifcloud.go index 7d052353..c21b8e39 100644 --- a/providers/dns/nifcloud/nifcloud.go +++ b/providers/dns/nifcloud/nifcloud.go @@ -7,11 +7,10 @@ import ( "net/http" "time" - "github.com/go-acme/lego/v3/providers/dns/nifcloud/internal" - "github.com/go-acme/lego/v3/challenge/dns01" "github.com/go-acme/lego/v3/platform/config/env" "github.com/go-acme/lego/v3/platform/wait" + "github.com/go-acme/lego/v3/providers/dns/nifcloud/internal" ) // Environment variables names.