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)
|
context := NewContext(a, set, set)
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Println("Incorrect Usage.\n")
|
fmt.Printf("Incorrect Usage.\n\n")
|
||||||
ShowAppHelp(context)
|
ShowAppHelp(context)
|
||||||
fmt.Println("")
|
fmt.Println("")
|
||||||
return err
|
return err
|
||||||
|
@ -14,7 +14,7 @@ func ExampleApp() {
|
|||||||
app := cli.NewApp()
|
app := cli.NewApp()
|
||||||
app.Name = "greet"
|
app.Name = "greet"
|
||||||
app.Flags = []cli.Flag{
|
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) {
|
app.Action = func(c *cli.Context) {
|
||||||
fmt.Printf("Hello %v\n", c.String("name"))
|
fmt.Printf("Hello %v\n", c.String("name"))
|
||||||
@ -72,7 +72,7 @@ func TestApp_CommandWithArgBeforeFlags(t *testing.T) {
|
|||||||
command := cli.Command{
|
command := cli.Command{
|
||||||
Name: "cmd",
|
Name: "cmd",
|
||||||
Flags: []cli.Flag{
|
Flags: []cli.Flag{
|
||||||
cli.StringFlag{"option", "", "some option"},
|
cli.StringFlag{Name: "option", Value: "", Usage: "some option"},
|
||||||
},
|
},
|
||||||
Action: func(c *cli.Context) {
|
Action: func(c *cli.Context) {
|
||||||
parsedOption = c.String("option")
|
parsedOption = c.String("option")
|
||||||
@ -96,8 +96,8 @@ func TestApp_ParseSliceFlags(t *testing.T) {
|
|||||||
command := cli.Command{
|
command := cli.Command{
|
||||||
Name: "cmd",
|
Name: "cmd",
|
||||||
Flags: []cli.Flag{
|
Flags: []cli.Flag{
|
||||||
cli.IntSliceFlag{"p", &cli.IntSlice{}, "set one or more ip addr"},
|
cli.IntSliceFlag{Name: "p", Value: &cli.IntSlice{}, Usage: "set one or more ip addr"},
|
||||||
cli.StringSliceFlag{"ip", &cli.StringSlice{}, "set one or more ports to open"},
|
cli.StringSliceFlag{Name: "ip", Value: &cli.StringSlice{}, Usage: "set one or more ports to open"},
|
||||||
},
|
},
|
||||||
Action: func(c *cli.Context) {
|
Action: func(c *cli.Context) {
|
||||||
parsedIntSlice = c.IntSlice("p")
|
parsedIntSlice = c.IntSlice("p")
|
||||||
|
@ -51,7 +51,7 @@ func (c Command) Run(ctx *Context) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Println("Incorrect Usage.\n")
|
fmt.Printf("Incorrect Usage.\n\n")
|
||||||
ShowCommandHelp(ctx, c.Name)
|
ShowCommandHelp(ctx, c.Name)
|
||||||
fmt.Println("")
|
fmt.Println("")
|
||||||
return err
|
return err
|
||||||
|
Loading…
Reference in New Issue
Block a user