From ca2aeb5a3e6521d146d971c5ebe4a7d46fa94086 Mon Sep 17 00:00:00 2001 From: "Aaron.L.Xu" Date: Thu, 16 Feb 2017 23:56:53 +0800 Subject: [PATCH] why there are so many mistakes in our repo (up to /cmd) Signed-off-by: Aaron.L.Xu --- command/container/exec.go | 2 +- command/formatter/reflect.go | 2 +- command/image/build.go | 2 +- command/image/build/context.go | 2 +- command/network/create.go | 2 +- command/swarm/init_test.go | 2 +- compose/types/types.go | 2 +- config/credentials/native_store.go | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/command/container/exec.go b/command/container/exec.go index 73329869a6..676708c77b 100644 --- a/command/container/exec.go +++ b/command/container/exec.go @@ -32,7 +32,7 @@ func newExecOptions() *execOptions { } } -// NewExecCommand creats a new cobra.Command for `docker exec` +// NewExecCommand creates a new cobra.Command for `docker exec` func NewExecCommand(dockerCli *command.DockerCli) *cobra.Command { opts := newExecOptions() diff --git a/command/formatter/reflect.go b/command/formatter/reflect.go index d1d8737d21..9692bbce7d 100644 --- a/command/formatter/reflect.go +++ b/command/formatter/reflect.go @@ -22,7 +22,7 @@ func marshalMap(x interface{}) (map[string]interface{}, error) { return nil, fmt.Errorf("expected a pointer to a struct, got %v", val.Kind()) } if val.IsNil() { - return nil, fmt.Errorf("expxected a pointer to a struct, got nil pointer") + return nil, fmt.Errorf("expected a pointer to a struct, got nil pointer") } valElem := val.Elem() if valElem.Kind() != reflect.Struct { diff --git a/command/image/build.go b/command/image/build.go index 96d90cf585..34c231d63e 100644 --- a/command/image/build.go +++ b/command/image/build.go @@ -120,7 +120,7 @@ func NewBuildCommand(dockerCli *command.DockerCli) *cobra.Command { // lastProgressOutput is the same as progress.Output except // that it only output with the last update. It is used in -// non terminal scenarios to depresss verbose messages +// non terminal scenarios to suppress verbose messages type lastProgressOutput struct { output progress.Output } diff --git a/command/image/build/context.go b/command/image/build/context.go index 86157c359d..9ea065adf8 100644 --- a/command/image/build/context.go +++ b/command/image/build/context.go @@ -91,7 +91,7 @@ func GetContextFromReader(r io.ReadCloser, dockerfileName string) (out io.ReadCl // Input should be read as a Dockerfile. tmpDir, err := ioutil.TempDir("", "docker-build-context-") if err != nil { - return nil, "", fmt.Errorf("unbale to create temporary context directory: %v", err) + return nil, "", fmt.Errorf("unable to create temporary context directory: %v", err) } f, err := os.Create(filepath.Join(tmpDir, DefaultDockerfileName)) diff --git a/command/network/create.go b/command/network/create.go index 57c59ed053..21300d7839 100644 --- a/command/network/create.go +++ b/command/network/create.go @@ -106,7 +106,7 @@ func runCreate(dockerCli *command.DockerCli, opts createOptions) error { // Consolidates the ipam configuration as a group from different related configurations // user can configure network with multiple non-overlapping subnets and hence it is // possible to correlate the various related parameters and consolidate them. -// consoidateIpam consolidates subnets, ip-ranges, gateways and auxiliary addresses into +// consolidateIpam consolidates subnets, ip-ranges, gateways and auxiliary addresses into // structured ipam data. func consolidateIpam(subnets, ranges, gateways []string, auxaddrs map[string]string) ([]network.IPAMConfig, error) { if len(subnets) < len(ranges) || len(subnets) < len(gateways) { diff --git a/command/swarm/init_test.go b/command/swarm/init_test.go index 13de1cd550..4f56de357f 100644 --- a/command/swarm/init_test.go +++ b/command/swarm/init_test.go @@ -31,7 +31,7 @@ func TestSwarmInitErrorOnAPIFailure(t *testing.T) { expectedError: "error initializing the swarm", }, { - name: "init-faild-with-ip-choice", + name: "init-failed-with-ip-choice", swarmInitFunc: func() (string, error) { return "", fmt.Errorf("could not choose an IP address to advertise") }, diff --git a/compose/types/types.go b/compose/types/types.go index c74014fb14..66c1641861 100644 --- a/compose/types/types.go +++ b/compose/types/types.go @@ -137,7 +137,7 @@ type StringOrNumberList []string // key=value strings type MappingWithEquals map[string]string -// MappingWithColon is a mapping type that can be converted from alist of +// MappingWithColon is a mapping type that can be converted from a list of // 'key: value' strings type MappingWithColon map[string]string diff --git a/config/credentials/native_store.go b/config/credentials/native_store.go index 9e0ab7f0f8..68a87e8c66 100644 --- a/config/credentials/native_store.go +++ b/config/credentials/native_store.go @@ -120,7 +120,7 @@ func (c *nativeStore) getCredentialsFromStore(serverAddress string) (types.AuthC if err != nil { if credentials.IsErrCredentialsNotFound(err) { // do not return an error if the credentials are not - // in the keyckain. Let docker ask for new credentials. + // in the keychain. Let docker ask for new credentials. return ret, nil } return ret, err