diff --git a/app_test.go b/app_test.go index cf0e3d0..9414c1b 100644 --- a/app_test.go +++ b/app_test.go @@ -43,7 +43,7 @@ func ExampleAppSubcommand() { Usage: "sends a greeting in english", Description: "greets someone in english", Flags: []cli.Flag{ - cli.StringFlag{"name", "Bob", "Name of the person to greet"}, + cli.StringFlag{Name: "name", Value: "Bob", Usage: "Name of the person to greet"}, }, Action: func(c *cli.Context) { fmt.Println("Hello,", c.String("name")) @@ -255,11 +255,11 @@ func TestApp_ParseSliceFlags(t *testing.T) { var expectedStringSlice = []string{"8.8.8.8", "8.8.4.4"} if !IntsEquals(parsedIntSlice, expectedIntSlice) { - t.Errorf("%s does not match %s", parsedIntSlice, expectedIntSlice) + t.Errorf("%v does not match %v", parsedIntSlice, expectedIntSlice) } if !StrsEquals(parsedStringSlice, expectedStringSlice) { - t.Errorf("%s does not match %s", parsedStringSlice, expectedStringSlice) + t.Errorf("%v does not match %v", parsedStringSlice, expectedStringSlice) } } diff --git a/cli_test.go b/cli_test.go index 30f3c13..4d7bd84 100644 --- a/cli_test.go +++ b/cli_test.go @@ -1,8 +1,9 @@ package cli_test import ( - "github.com/codegangsta/cli" "os" + + "github.com/codegangsta/cli" ) func Example() { @@ -47,7 +48,7 @@ func ExampleSubcommand() { Usage: "sends a greeting in english", Description: "greets someone in english", Flags: []cli.Flag{ - cli.StringFlag{"name", "Bob", "Name of the person to greet"}, + cli.StringFlag{Name: "name", Value: "Bob", Usage: "Name of the person to greet"}, }, Action: func(c *cli.Context) { println("Hello, ", c.String("name")) @@ -57,7 +58,7 @@ func ExampleSubcommand() { ShortName: "sp", Usage: "sends a greeting in spanish", Flags: []cli.Flag{ - cli.StringFlag{"surname", "Jones", "Surname of the person to greet"}, + cli.StringFlag{Name: "surname", Value: "Jones", Usage: "Surname of the person to greet"}, }, Action: func(c *cli.Context) { println("Hola, ", c.String("surname")) @@ -67,7 +68,7 @@ func ExampleSubcommand() { ShortName: "fr", Usage: "sends a greeting in french", Flags: []cli.Flag{ - cli.StringFlag{"nickname", "Stevie", "Nickname of the person to greet"}, + cli.StringFlag{Name: "nickname", Value: "Stevie", Usage: "Nickname of the person to greet"}, }, Action: func(c *cli.Context) { println("Bonjour, ", c.String("nickname"))