From 10c56efa9730cc84274593de89c4cc90cbc83ae6 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Mon, 4 Jul 2022 10:07:58 +0200 Subject: [PATCH] linting: error strings should not be capitalized (revive) client/request.go:183:28: error-strings: error strings should not be capitalized or end with punctuation or a newline (revive) err = errors.Wrap(err, "In the default daemon configuration on Windows, the docker client must be run with elevated privileges to connect.") ^ client/request.go:186:28: error-strings: error strings should not be capitalized or end with punctuation or a newline (revive) err = errors.Wrap(err, "This error may indicate that the docker daemon is not running.") ^ Signed-off-by: Sebastiaan van Stijn --- client/request.go | 8 ++++---- daemon/network.go | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/client/request.go b/client/request.go index 086db59d01..c799095c12 100644 --- a/client/request.go +++ b/client/request.go @@ -141,7 +141,7 @@ func (cli *Client) doRequest(ctx context.Context, req *http.Request) (serverResp } if cli.scheme == "https" && strings.Contains(err.Error(), "bad certificate") { - return serverResp, errors.Wrap(err, "The server probably has client authentication (--tlsverify) enabled. Please check your TLS client certification settings") + return serverResp, errors.Wrap(err, "the server probably has client authentication (--tlsverify) enabled; check your TLS client certification settings") } // Don't decorate context sentinel errors; users may be comparing to @@ -153,7 +153,7 @@ func (cli *Client) doRequest(ctx context.Context, req *http.Request) (serverResp if nErr, ok := err.(*url.Error); ok { if nErr, ok := nErr.Err.(*net.OpError); ok { if os.IsPermission(nErr.Err) { - return serverResp, errors.Wrapf(err, "Got permission denied while trying to connect to the Docker daemon socket at %v", cli.host) + return serverResp, errors.Wrapf(err, "permission denied while trying to connect to the Docker daemon socket at %v", cli.host) } } } @@ -180,10 +180,10 @@ func (cli *Client) doRequest(ctx context.Context, req *http.Request) (serverResp if strings.Contains(err.Error(), `open //./pipe/docker_engine`) { // Checks if client is running with elevated privileges if f, elevatedErr := os.Open("\\\\.\\PHYSICALDRIVE0"); elevatedErr == nil { - err = errors.Wrap(err, "In the default daemon configuration on Windows, the docker client must be run with elevated privileges to connect.") + err = errors.Wrap(err, "in the default daemon configuration on Windows, the docker client must be run with elevated privileges to connect") } else { f.Close() - err = errors.Wrap(err, "This error may indicate that the docker daemon is not running.") + err = errors.Wrap(err, "this error may indicate that the docker daemon is not running") } } diff --git a/daemon/network.go b/daemon/network.go index fc84eaa164..a650d09b9a 100644 --- a/daemon/network.go +++ b/daemon/network.go @@ -356,7 +356,7 @@ func (daemon *Daemon) createNetwork(create types.NetworkCreateRequest, id string if agent && driver == "overlay" { nodeIP, exists := daemon.GetAttachmentStore().GetIPForNetwork(id) if !exists { - return nil, fmt.Errorf("Failed to find a load balancer IP to use for network: %v", id) + return nil, fmt.Errorf("failed to find a load balancer IP to use for network: %v", id) } nwOptions = append(nwOptions, libnetwork.NetworkOptionLBEndpoint(nodeIP))