Fix golint errors in docker/api/client

Signed-off-by: Peggy Li <peggyli.224@gmail.com>
Upstream-commit: 58065d0dd9adec4b2f397a453652cc8cc7237a17
Component: engine
This commit is contained in:
Peggy Li
2015-04-21 23:45:18 -07:00
parent 1b7f0b8878
commit ed4e61e70a
5 changed files with 22 additions and 10 deletions

View File

@ -29,9 +29,10 @@ import (
)
var (
ErrConnectionRefused = errors.New("Cannot connect to the Docker daemon. Is 'docker -d' running on this host?")
errConnectionRefused = errors.New("Cannot connect to the Docker daemon. Is 'docker -d' running on this host?")
)
// HTTPClient creates a new HTP client with the cli's client transport instance.
func (cli *DockerCli) HTTPClient() *http.Client {
return &http.Client{Transport: cli.transport}
}
@ -93,7 +94,7 @@ func (cli *DockerCli) clientRequest(method, path string, in io.Reader, headers m
}
if err != nil {
if strings.Contains(err.Error(), "connection refused") {
return nil, "", statusCode, ErrConnectionRefused
return nil, "", statusCode, errConnectionRefused
}
if cli.tlsConfig == nil {
@ -250,7 +251,7 @@ func getExitCode(cli *DockerCli, containerID string) (bool, int, error) {
stream, _, err := cli.call("GET", "/containers/"+containerID+"/json", nil, nil)
if err != nil {
// If we can't connect, then the daemon probably died.
if err != ErrConnectionRefused {
if err != errConnectionRefused {
return false, -1, err
}
return false, -1, nil
@ -271,7 +272,7 @@ func getExecExitCode(cli *DockerCli, execID string) (bool, int, error) {
stream, _, err := cli.call("GET", "/exec/"+execID+"/json", nil, nil)
if err != nil {
// If we can't connect, then the daemon probably died.
if err != ErrConnectionRefused {
if err != errConnectionRefused {
return false, -1, err
}
return false, -1, nil