Fixed all problems/warnings reported by "go vet"
This commit is contained in:
parent
30d83a70a7
commit
f93652a890
2
app.go
2
app.go
@ -51,7 +51,7 @@ func (a *App) Run(arguments []string) error {
|
||||
context := NewContext(a, set, set)
|
||||
|
||||
if err != nil {
|
||||
fmt.Println("Incorrect Usage.\n")
|
||||
fmt.Printf("Incorrect Usage.\n\n")
|
||||
ShowAppHelp(context)
|
||||
fmt.Println("")
|
||||
return err
|
||||
|
@ -14,7 +14,7 @@ func ExampleApp() {
|
||||
app := cli.NewApp()
|
||||
app.Name = "greet"
|
||||
app.Flags = []cli.Flag{
|
||||
cli.StringFlag{"name", "bob", "a name to say"},
|
||||
cli.StringFlag{Name: "name", Value: "bob", Usage: "a name to say"},
|
||||
}
|
||||
app.Action = func(c *cli.Context) {
|
||||
fmt.Printf("Hello %v\n", c.String("name"))
|
||||
@ -72,7 +72,7 @@ func TestApp_CommandWithArgBeforeFlags(t *testing.T) {
|
||||
command := cli.Command{
|
||||
Name: "cmd",
|
||||
Flags: []cli.Flag{
|
||||
cli.StringFlag{"option", "", "some option"},
|
||||
cli.StringFlag{Name: "option", Value: "", Usage: "some option"},
|
||||
},
|
||||
Action: func(c *cli.Context) {
|
||||
parsedOption = c.String("option")
|
||||
@ -96,8 +96,8 @@ func TestApp_ParseSliceFlags(t *testing.T) {
|
||||
command := cli.Command{
|
||||
Name: "cmd",
|
||||
Flags: []cli.Flag{
|
||||
cli.IntSliceFlag{"p", &cli.IntSlice{}, "set one or more ip addr"},
|
||||
cli.StringSliceFlag{"ip", &cli.StringSlice{}, "set one or more ports to open"},
|
||||
cli.IntSliceFlag{Name: "p", Value: &cli.IntSlice{}, Usage: "set one or more ip addr"},
|
||||
cli.StringSliceFlag{Name: "ip", Value: &cli.StringSlice{}, Usage: "set one or more ports to open"},
|
||||
},
|
||||
Action: func(c *cli.Context) {
|
||||
parsedIntSlice = c.IntSlice("p")
|
||||
|
@ -51,7 +51,7 @@ func (c Command) Run(ctx *Context) error {
|
||||
}
|
||||
|
||||
if err != nil {
|
||||
fmt.Println("Incorrect Usage.\n")
|
||||
fmt.Printf("Incorrect Usage.\n\n")
|
||||
ShowCommandHelp(ctx, c.Name)
|
||||
fmt.Println("")
|
||||
return err
|
||||
|
Loading…
Reference in New Issue
Block a user