Updating tests to pass `go vet`

Mostly lack of struct field names in literals and one sprintf format
specifier mismatch.
main
jszwedko 10 years ago
parent 5ddbbe33e5
commit bcfb32b8b0

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

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

Loading…
Cancel
Save