Browse code

review code about cmd/* and fix some easy typos :D

Signed-off-by: Aaron.L.Xu <likexu@harmonycloud.cn>

Aaron.L.Xu authored on 2017/02/10 16:35:05
Showing 2 changed files
... ...
@@ -4,6 +4,7 @@ import (
4 4
 	"errors"
5 5
 	"fmt"
6 6
 	"os"
7
+	"strings"
7 8
 
8 9
 	"github.com/Sirupsen/logrus"
9 10
 	"github.com/docker/docker/api/types/versions"
... ...
@@ -17,7 +18,6 @@ import (
17 17
 	"github.com/docker/docker/pkg/term"
18 18
 	"github.com/spf13/cobra"
19 19
 	"github.com/spf13/pflag"
20
-	"strings"
21 20
 )
22 21
 
23 22
 func newDockerCommand(dockerCli *command.DockerCli) *cobra.Command {
... ...
@@ -55,7 +55,7 @@ func newDockerCommand(dockerCli *command.DockerCli) *cobra.Command {
55 55
 	cli.SetupRootCommand(cmd)
56 56
 
57 57
 	cmd.SetHelpFunc(func(ccmd *cobra.Command, args []string) {
58
-		if dockerCli.Client() == nil { // when using --help, PersistenPreRun is not called, so initialization is needed.
58
+		if dockerCli.Client() == nil { // when using --help, PersistentPreRun is not called, so initialization is needed.
59 59
 			// flags must be the top-level command flags, not cmd.Flags()
60 60
 			opts.Common.SetDefaultOptions(flags)
61 61
 			dockerPreRun(opts)
... ...
@@ -111,7 +111,7 @@ func (l *MalformedHostHeaderOverrideConn) Read(b []byte) (n int, err error) {
111 111
 }
112 112
 
113 113
 // Accept makes the listener accepts connections and wraps the connection
114
-// in a MalformedHostHeaderOverrideConn initilizing first to true.
114
+// in a MalformedHostHeaderOverrideConn initializing first to true.
115 115
 func (l *MalformedHostHeaderOverride) Accept() (net.Conn, error) {
116 116
 	c, err := l.Listener.Accept()
117 117
 	if err != nil {