main
Tom Limoncelli 5 years ago
parent caa97b585e
commit dc7ae10a15

@ -1473,17 +1473,17 @@ Shell command to find them all: `fgrep -rl github.com/urfave/cli *`
#### Flag aliases are done differently. #### Flag aliases are done differently.
Change `Name: "foo, f` to "Name: "foo", Aliases: []string{"f"}` Change `Name: "foo, f"` to `Name: "foo", Aliases: []string{"f"}`
* OLD: * OLD:
``` ```go
cli.StringFlag{ cli.StringFlag{
Name: "config, cfg" Name: "config, cfg"
} }
``` ```
* NEW: * NEW:
``` ```go
cli.StringFlag{ cli.StringFlag{
Name: "config", Name: "config",
Aliases: []string{"cfg"}, Aliases: []string{"cfg"},
@ -1508,8 +1508,8 @@ Example:
Compiler messages you might see: Compiler messages you might see:
``` ```
commands/commands.go:56:30: cannot convert commands (type []cli.Command) to type cli.CommandsByName cannot convert commands (type []cli.Command) to type cli.CommandsByName
commands/commands.go:57:15: cannot use commands (type []cli.Command) as type []*cli.Command in assignment cannot use commands (type []cli.Command) as type []*cli.Command in assignment
``` ```
#### Lists of commands should be pointers #### Lists of commands should be pointers
@ -1523,7 +1523,7 @@ now be pointers.
Compiler messages you might see: Compiler messages you might see:
``` ```
./commands.go:32:34: cannot use cli.Command literal (type cli.Command) as type *cli.Command in argument to cannot use cli.Command literal (type cli.Command) as type *cli.Command in argument to
``` ```
#### cli.Flag changed #### cli.Flag changed
@ -1536,13 +1536,13 @@ If you make a list of flags, add a `&` in front of each
item. cli.BoolFlag, cli.StringFlag, etc. item. cli.BoolFlag, cli.StringFlag, etc.
* OLD: * OLD:
``` ```go
app.Flags = []cli.Flag{ app.Flags = []cli.Flag{
cli.BoolFlag{ cli.BoolFlag{
``` ```
* NEW: * NEW:
``` ```go
app.Flags = []cli.Flag{ app.Flags = []cli.Flag{
&cli.BoolFlag{ &cli.BoolFlag{
``` ```
@ -1564,7 +1564,7 @@ now pointers.
Compiler messages you might see: Compiler messages you might see:
``` ```
commands/commands.go:28:19: cannot use c (type *cli.Command) as type cli.Command in append cannot use c (type *cli.Command) as type cli.Command in append
``` ```
#### Actions returns errors #### Actions returns errors
@ -1577,7 +1577,7 @@ A command's `Action:` now returns an `error`.
Compiler messages you might see: Compiler messages you might see:
``` ```
./commands.go:35:2: cannot use func literal (type func(*cli.Context)) as type cli.ActionFunc in field value cannot use func literal (type func(*cli.Context)) as type cli.ActionFunc in field value
``` ```
#### Everything else #### Everything else

Loading…
Cancel
Save