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 {
baseCommand = baseCommand + " " + serverName
args = args[1:]
} else {
err = errors.New("No server specified")
err = errors.New("no server specified")
hk.Printf("Error: %v\n\n", err)
hk.Usage()
return err
......
......@@ -50,7 +50,7 @@ func testServerError(n string) *Server {
Long: fmt.Sprintf("A simple server named %s that returns an error", n),
Run: func(s *Server, args []string) error {
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) {
func TestTopNoArgs(t *testing.T) {
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) {
......@@ -192,7 +192,7 @@ func TestServerFlagsBad(t *testing.T) {
func TestServerError(t *testing.T) {
x := runFull(t, "hyperkube test-error")
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) {
......
......@@ -138,7 +138,7 @@ func (hk *HyperKube) Run(args []string) error {
baseCommand = baseCommand + " " + serverName
args = args[1:]
} else {
err = errors.New("No server specified")
err = errors.New("no server specified")
hk.Printf("Error: %v\n\n", err)
hk.Usage()
return err
......
......@@ -48,7 +48,7 @@ func testServerError(n string) *Server {
Long: fmt.Sprintf("A simple server named %s that returns an error", n),
Run: func(s *Server, args []string) error {
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) {
func TestTopNoArgs(t *testing.T) {
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) {
......@@ -140,5 +140,5 @@ func TestServerFlagsBad(t *testing.T) {
func TestServerError(t *testing.T) {
x := runFull(t, "hyperkube test-error")
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