From 7dfd69cdc5966ae454e35cd6e976686131bfda8d Mon Sep 17 00:00:00 2001 From: Mohammed Al Sahaf Date: Thu, 9 Apr 2020 00:31:51 +0300 Subject: chore: make the linter happier (#3245) * chore: make the linter happier * chore: remove reference to maligned linter in .golangci.yml --- modules/caddytls/automation.go | 2 +- modules/caddytls/fileloader.go | 2 +- modules/caddytls/pemloader.go | 2 +- modules/caddytls/tls.go | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) (limited to 'modules/caddytls') diff --git a/modules/caddytls/automation.go b/modules/caddytls/automation.go index 87e6b28..c623b82 100644 --- a/modules/caddytls/automation.go +++ b/modules/caddytls/automation.go @@ -150,7 +150,7 @@ func (ap *AutomationPolicy) Provision(tlsApp *TLS) error { // none of the subjects qualify for a public certificate, // set the issuer to internal so that these names can all // get certificates; critically, we can only do this if an - // issuer is not explictly configured (IssuerRaw, vs. just + // issuer is not explicitly configured (IssuerRaw, vs. just // Issuer) AND if the list of subjects is non-empty if ap.IssuerRaw == nil && len(ap.Subjects) > 0 { var anyPublic bool diff --git a/modules/caddytls/fileloader.go b/modules/caddytls/fileloader.go index 6d6ff99..fdf5486 100644 --- a/modules/caddytls/fileloader.go +++ b/modules/caddytls/fileloader.go @@ -57,7 +57,7 @@ type CertKeyFilePair struct { // LoadCertificates returns the certificates to be loaded by fl. func (fl FileLoader) LoadCertificates() ([]Certificate, error) { - var certs []Certificate + certs := make([]Certificate, 0, len(fl)) for _, pair := range fl { certData, err := ioutil.ReadFile(pair.Certificate) if err != nil { diff --git a/modules/caddytls/pemloader.go b/modules/caddytls/pemloader.go index 46d06a8..bd95781 100644 --- a/modules/caddytls/pemloader.go +++ b/modules/caddytls/pemloader.go @@ -54,7 +54,7 @@ type CertKeyPEMPair struct { // LoadCertificates returns the certificates contained in pl. func (pl PEMLoader) LoadCertificates() ([]Certificate, error) { - var certs []Certificate + certs := make([]Certificate, 0, len(pl)) for i, pair := range pl { cert, err := tls.X509KeyPair([]byte(pair.CertificatePEM), []byte(pair.KeyPEM)) if err != nil { diff --git a/modules/caddytls/tls.go b/modules/caddytls/tls.go index 1255d3d..ea80fa9 100644 --- a/modules/caddytls/tls.go +++ b/modules/caddytls/tls.go @@ -471,7 +471,7 @@ func (t *TLS) moveCertificates() error { } // get list of used CAs - var oldCANames []string + oldCANames := make([]string, 0, len(oldAcmeCas)) for _, fi := range oldAcmeCas { if !fi.IsDir() { continue -- cgit v1.2.3