diff options
author | 2017-06-14 09:37:10 -0700 | |
---|---|---|
committer | 2017-06-14 09:37:10 -0700 | |
commit | e49ca86ce463395f7d0d2b997c93d25e3d101ca0 (patch) | |
tree | 9457aa245a6ccc278a296d341370eae99e1f78b2 /middleware/pkg/tls/tls.go | |
parent | 5c10eba31c17dcc5d95431e655280fff19979a34 (diff) | |
download | coredns-e49ca86ce463395f7d0d2b997c93d25e3d101ca0.tar.gz coredns-e49ca86ce463395f7d0d2b997c93d25e3d101ca0.tar.zst coredns-e49ca86ce463395f7d0d2b997c93d25e3d101ca0.zip |
cleanup: go vet and golint run (#736)
* cleanup: go vet and golint run
Various cleanups trickered by go vet and golint.
* Fix tests and lowercase all errors
Lowercase all errors, some tests in kubernetes use errors from
kubernetes which do start with a capital letter.
Diffstat (limited to 'middleware/pkg/tls/tls.go')
-rw-r--r-- | middleware/pkg/tls/tls.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/middleware/pkg/tls/tls.go b/middleware/pkg/tls/tls.go index 7ec30c4ff..62889f542 100644 --- a/middleware/pkg/tls/tls.go +++ b/middleware/pkg/tls/tls.go @@ -50,7 +50,7 @@ func NewTLSConfigFromArgs(args ...string) (*tls.Config, error) { // Client cert, use specified CA c, err = NewTLSConfig(args[0], args[1], args[2]) default: - err = fmt.Errorf("Maximum of three arguments allowed for TLS config, found %d", len(args)) + err = fmt.Errorf("maximum of three arguments allowed for TLS config, found %d", len(args)) } if err != nil { return nil, err @@ -64,7 +64,7 @@ func NewTLSConfigFromArgs(args ...string) (*tls.Config, error) { func NewTLSConfig(certPath, keyPath, caPath string) (*tls.Config, error) { cert, err := tls.LoadX509KeyPair(certPath, keyPath) if err != nil { - return nil, fmt.Errorf("Could not load TLS cert: %s", err) + return nil, fmt.Errorf("could not load TLS cert: %s", err) } roots, err := loadRoots(caPath) @@ -94,11 +94,11 @@ func loadRoots(caPath string) (*x509.CertPool, error) { roots := x509.NewCertPool() pem, err := ioutil.ReadFile(caPath) if err != nil { - return nil, fmt.Errorf("Error reading %s: %s", caPath, err) + return nil, fmt.Errorf("error reading %s: %s", caPath, err) } ok := roots.AppendCertsFromPEM(pem) if !ok { - return nil, fmt.Errorf("Could not read root certs: %s", err) + return nil, fmt.Errorf("could not read root certs: %s", err) } return roots, nil } |