In error, the first letter is low-case letter

Signed-off-by: YuPengZTE <yu.peng36@zte.com.cn>
This commit is contained in:
YuPengZTE 2016-09-08 19:32:37 +08:00
parent cbd2a21e63
commit 9b3a79bfd1
4 changed files with 8 additions and 8 deletions

View File

@ -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

View File

@ -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) {
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) {
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) {

View File

@ -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

View File

@ -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) {
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) {
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")
} }