git » kxd » commit 41deb81

Make error messages lowercase, for consistency

author Alberto Bertogli
2019-08-10 09:51:55 UTC
committer Alberto Bertogli
2019-08-31 16:26:53 UTC
parent 14eab774790713c8ce5c4bf7f6d1f8bcd1fca808

Make error messages lowercase, for consistency

Error messages in Go are usually lowercase, this commit adjust a few of
them to match that style, for consistency.

kxc/kxc.go +2 -2
kxd/key_config.go +2 -2
kxd/kxd.go +1 -1

diff --git a/kxc/kxc.go b/kxc/kxc.go
index 955cc3e..d79bf47 100644
--- a/kxc/kxc.go
+++ b/kxc/kxc.go
@@ -35,7 +35,7 @@ func loadServerCerts() (*x509.CertPool, error) {
 
 	pool := x509.NewCertPool()
 	if !pool.AppendCertsFromPEM(pemData) {
-		return nil, fmt.Errorf("Error appending certificates")
+		return nil, fmt.Errorf("error appending certificates")
 	}
 
 	return pool, nil
@@ -61,7 +61,7 @@ func extractURL(rawurl string) (*url.URL, error) {
 	case "http", "kxd":
 		serverURL.Scheme = "https"
 	default:
-		return nil, fmt.Errorf("Unsupported URL schema (try kxd://)")
+		return nil, fmt.Errorf("unsupported URL schema (try kxd://)")
 	}
 
 	// The path must begin with /v1/, although we hide that from the user
diff --git a/kxd/key_config.go b/kxd/key_config.go
index 09f56ff..e3c339e 100644
--- a/kxd/key_config.go
+++ b/kxd/key_config.go
@@ -90,7 +90,7 @@ func (kc *KeyConfig) LoadClientCerts() error {
 	}
 
 	if !kc.allowedClientCerts.AppendCertsFromPEM(rawContents) {
-		return fmt.Errorf("Error parsing client certificate file")
+		return fmt.Errorf("error parsing client certificate file")
 	}
 
 	return nil
@@ -162,7 +162,7 @@ func (kc *KeyConfig) IsHostAllowed(addr string) error {
 		}
 	}
 
-	return fmt.Errorf("Host %q not allowed", host)
+	return fmt.Errorf("host %q not allowed", host)
 }
 
 // Key returns the private key.
diff --git a/kxd/kxd.go b/kxd/kxd.go
index 128c65c..3e1911b 100644
--- a/kxd/kxd.go
+++ b/kxd/kxd.go
@@ -65,7 +65,7 @@ func (req *Request) KeyPath() (string, error) {
 
 	// We expect the path to be "/v1/path/to/key".
 	if len(s) < 2 || !(s[0] == "" || s[1] == "v1") {
-		return "", fmt.Errorf("Invalid path %q", s)
+		return "", fmt.Errorf("invalid path %q", s)
 	}
 
 	return strings.Join(s[2:], "/"), nil