Commit 9b3a79bf authored by YuPengZTE's avatar YuPengZTE

In error, the first letter is low-case letter

parent cbd2a21e
...@@ -149,7 +149,7 @@ func (hk *HyperKube) Run(args []string) error { ...@@ -149,7 +149,7 @@ func (hk *HyperKube) Run(args []string) error {
baseCommand = baseCommand + " " + serverName baseCommand = baseCommand + " " + serverName
args = args[1:] args = args[1:]
} else { } else {
err = errors.New("No server specified") err = errors.New("no server specified")
hk.Printf("Error: %v\n\n", err) hk.Printf("Error: %v\n\n", err)
hk.Usage() hk.Usage()
return err return err
......
...@@ -50,7 +50,7 @@ func testServerError(n string) *Server { ...@@ -50,7 +50,7 @@ func testServerError(n string) *Server {
Long: fmt.Sprintf("A simple server named %s that returns an error", n), Long: fmt.Sprintf("A simple server named %s that returns an error", n),
Run: func(s *Server, args []string) error { Run: func(s *Server, args []string) error {
s.hk.Printf("%s Run\n", s.Name()) s.hk.Printf("%s Run\n", s.Name())
return errors.New("Server returning error") return errors.New("server returning error")
}, },
} }
} }
...@@ -142,7 +142,7 @@ func TestLinkRun(t *testing.T) { ...@@ -142,7 +142,7 @@ func TestLinkRun(t *testing.T) {
func TestTopNoArgs(t *testing.T) { func TestTopNoArgs(t *testing.T) {
x := runFull(t, "hyperkube") x := runFull(t, "hyperkube")
assert.EqualError(t, x.err, "No server specified") assert.EqualError(t, x.err, "no server specified")
} }
func TestBadServer(t *testing.T) { func TestBadServer(t *testing.T) {
...@@ -192,7 +192,7 @@ func TestServerFlagsBad(t *testing.T) { ...@@ -192,7 +192,7 @@ func TestServerFlagsBad(t *testing.T) {
func TestServerError(t *testing.T) { func TestServerError(t *testing.T) {
x := runFull(t, "hyperkube test-error") x := runFull(t, "hyperkube test-error")
assert.Contains(t, x.output, "test-error Run") assert.Contains(t, x.output, "test-error Run")
assert.EqualError(t, x.err, "Server returning error") assert.EqualError(t, x.err, "server returning error")
} }
func TestCobraCommandHelp(t *testing.T) { func TestCobraCommandHelp(t *testing.T) {
......
...@@ -138,7 +138,7 @@ func (hk *HyperKube) Run(args []string) error { ...@@ -138,7 +138,7 @@ func (hk *HyperKube) Run(args []string) error {
baseCommand = baseCommand + " " + serverName baseCommand = baseCommand + " " + serverName
args = args[1:] args = args[1:]
} else { } else {
err = errors.New("No server specified") err = errors.New("no server specified")
hk.Printf("Error: %v\n\n", err) hk.Printf("Error: %v\n\n", err)
hk.Usage() hk.Usage()
return err return err
......
...@@ -48,7 +48,7 @@ func testServerError(n string) *Server { ...@@ -48,7 +48,7 @@ func testServerError(n string) *Server {
Long: fmt.Sprintf("A simple server named %s that returns an error", n), Long: fmt.Sprintf("A simple server named %s that returns an error", n),
Run: func(s *Server, args []string) error { Run: func(s *Server, args []string) error {
s.hk.Printf("%s Run\n", s.Name()) s.hk.Printf("%s Run\n", s.Name())
return errors.New("Server returning error") return errors.New("server returning error")
}, },
} }
} }
...@@ -90,7 +90,7 @@ func TestLinkRun(t *testing.T) { ...@@ -90,7 +90,7 @@ func TestLinkRun(t *testing.T) {
func TestTopNoArgs(t *testing.T) { func TestTopNoArgs(t *testing.T) {
x := runFull(t, "hyperkube") x := runFull(t, "hyperkube")
assert.EqualError(t, x.err, "No server specified") assert.EqualError(t, x.err, "no server specified")
} }
func TestBadServer(t *testing.T) { func TestBadServer(t *testing.T) {
...@@ -140,5 +140,5 @@ func TestServerFlagsBad(t *testing.T) { ...@@ -140,5 +140,5 @@ func TestServerFlagsBad(t *testing.T) {
func TestServerError(t *testing.T) { func TestServerError(t *testing.T) {
x := runFull(t, "hyperkube test-error") x := runFull(t, "hyperkube test-error")
assert.Contains(t, x.output, "test-error Run") assert.Contains(t, x.output, "test-error Run")
assert.EqualError(t, x.err, "Server returning error") assert.EqualError(t, x.err, "server returning error")
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment