diff --git a/clair/layer.go b/clair/layer.go index e1ccba0a..18f8df07 100644 --- a/clair/layer.go +++ b/clair/layer.go @@ -85,5 +85,5 @@ func (c *Clair) DeleteLayer(ctx context.Context, name string) error { return nil } - return fmt.Errorf("Got status code: %d", resp.StatusCode) + return fmt.Errorf("got status code: %d", resp.StatusCode) } diff --git a/list.go b/list.go index 404c87e8..ce64de79 100644 --- a/list.go +++ b/list.go @@ -38,7 +38,7 @@ func (cmd *listCommand) Run(ctx context.Context, args []string) error { repos, err := r.Catalog(ctx, "") if err != nil { if _, ok := err.(*json.SyntaxError); ok { - return fmt.Errorf("Domain %s is not a valid registry", r.Domain) + return fmt.Errorf("domain %s is not a valid registry", r.Domain) } return err } diff --git a/main.go b/main.go index e550d567..ebd5a3df 100644 --- a/main.go +++ b/main.go @@ -78,7 +78,7 @@ func main() { // Set the before function. p.Before = func(ctx context.Context) error { // On ^C, or SIGTERM handle exit. - signals := make(chan os.Signal, 0) + signals := make(chan os.Signal) signal.Notify(signals, os.Interrupt) signal.Notify(signals, syscall.SIGTERM) _, cancel := context.WithCancel(ctx) @@ -115,7 +115,7 @@ func createRegistryClient(ctx context.Context, domain string) (*registry.Registr // Prevent non-ssl unless explicitly forced if !forceNonSSL && strings.HasPrefix(auth.ServerAddress, "http:") { - return nil, fmt.Errorf("Attempted to use insecure protocol! Use force-non-ssl option to force") + return nil, fmt.Errorf("attempted to use insecure protocol! Use force-non-ssl option to force") } // Create the registry client. diff --git a/registry/delete.go b/registry/delete.go index 6bd6a9bd..3b44c0d4 100644 --- a/registry/delete.go +++ b/registry/delete.go @@ -32,5 +32,5 @@ func (r *Registry) Delete(ctx context.Context, repository string, digest digest. return nil } - return fmt.Errorf("Got status code: %d", resp.StatusCode) + return fmt.Errorf("got status code: %d", resp.StatusCode) } diff --git a/registry/digest.go b/registry/digest.go index a1346f31..361ae474 100644 --- a/registry/digest.go +++ b/registry/digest.go @@ -33,7 +33,7 @@ func (r *Registry) Digest(ctx context.Context, image Image) (digest.Digest, erro defer resp.Body.Close() if resp.StatusCode != http.StatusOK && resp.StatusCode != http.StatusNotFound { - return "", fmt.Errorf("Got status code: %d", resp.StatusCode) + return "", fmt.Errorf("got status code: %d", resp.StatusCode) } return digest.Parse(resp.Header.Get("Docker-Content-Digest")) diff --git a/registry/tokentransport.go b/registry/tokentransport.go index 0dea8d92..6af11d1a 100644 --- a/registry/tokentransport.go +++ b/registry/tokentransport.go @@ -195,7 +195,7 @@ func (r *Registry) Token(ctx context.Context, url string) (string, error) { defer resp.Body.Close() if resp.StatusCode != http.StatusOK { - return "", fmt.Errorf("Getting token failed with StatusCode != StatusOK but %d", resp.StatusCode) + return "", fmt.Errorf("getting token failed with StatusCode != StatusOK but %d", resp.StatusCode) } var authToken authToken diff --git a/repoutils/repoutils.go b/repoutils/repoutils.go index 819e7261..75c7324b 100644 --- a/repoutils/repoutils.go +++ b/repoutils/repoutils.go @@ -31,7 +31,7 @@ func GetAuthConfig(username, password, registry string) (types.AuthConfig, error dcfg, err := config.Load(config.Dir()) if err != nil { - return types.AuthConfig{}, fmt.Errorf("Loading config file failed: %v", err) + return types.AuthConfig{}, fmt.Errorf("loading config file failed: %v", err) } // return error early if there are no auths saved @@ -49,7 +49,7 @@ func GetAuthConfig(username, password, registry string) (types.AuthConfig, error authConfigs, err := dcfg.GetAllCredentials() if err != nil { - return types.AuthConfig{}, fmt.Errorf("Getting credentials failed: %v", err) + return types.AuthConfig{}, fmt.Errorf("getting credentials failed: %v", err) } // if they passed a specific registry, return those creds _if_ they exist diff --git a/repoutils/repoutils_test.go b/repoutils/repoutils_test.go index 02f10bc3..0238fd06 100644 --- a/repoutils/repoutils_test.go +++ b/repoutils/repoutils_test.go @@ -35,7 +35,7 @@ func TestGetAuthConfig(t *testing.T) { { name: "invalid config dir", configdir: "testdata/invalid", - err: errors.New("Loading config file failed: "), + err: errors.New("loading config file failed: "), config: types.AuthConfig{}, }, { diff --git a/testutils/testutils.go b/testutils/testutils.go index 8aa79dc5..fcf61aee 100644 --- a/testutils/testutils.go +++ b/testutils/testutils.go @@ -33,7 +33,7 @@ import ( func StartRegistry(dcli *client.Client, config, username, password string) (string, string, error) { _, filename, _, ok := runtime.Caller(0) if !ok { - return "", "", errors.New("No caller information") + return "", "", errors.New("no caller information") } image := "registry:2" @@ -126,7 +126,7 @@ func startClairDB(dcli *client.Client) (string, error) { func StartClair(dcli *client.Client) (string, string, error) { _, filename, _, ok := runtime.Caller(0) if !ok { - return "", "", errors.New("No caller information") + return "", "", errors.New("no caller information") } // start the database container. @@ -284,7 +284,7 @@ func imageExists(dcli *client.Client, image string) (bool, error) { func waitForConn(addr, cert, key string) error { tlsCert, err := tls.LoadX509KeyPair(cert, key) if err != nil { - return fmt.Errorf("Could not load X509 key pair: %v. Make sure the key is not encrypted", err) + return fmt.Errorf("could not load X509 key pair: %v. Make sure the key is not encrypted", err) } certPool, err := x509.SystemCertPool()