Fixed all problems/warnings reported by "go vet"

This commit is contained in:
Alexander Rødseth 2013-11-15 11:35:24 +01:00
parent 30d83a70a7
commit f93652a890
3 changed files with 6 additions and 6 deletions

2
app.go
View File

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

View File

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

View File

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