Skip to content

Commit

Permalink
Update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
dearchap committed Nov 1, 2024
1 parent 2c876d2 commit 68f9c2c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion docs/migrate-v2-to-v3.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ in addition to other specific args. This allows handler functions to utilize con
blocking/time-specific operations and so on

* OLD: `type BeforeFunc func(*Context) error`
* NEW: `type BeforeFunc func(context.Context, *cli.Command) error`
* NEW: `type BeforeFunc func(context.Context, *cli.Command) (context.Context, error)`

* OLD: `type AfterFunc func(*Context) error`
* NEW: `type AfterFunc func(context.Context, *cli.Command) error`
Expand Down
4 changes: 2 additions & 2 deletions docs/v3/examples/full-api-example.md
Original file line number Diff line number Diff line change
Expand Up @@ -153,9 +153,9 @@ func main() {
ShellComplete: func(ctx context.Context, cmd *cli.Command) {
fmt.Fprintf(cmd.Root().Writer, "lipstick\nkiss\nme\nlipstick\nringo\n")
},
Before: func(ctx context.Context, cmd *cli.Command) error {
Before: func(ctx context.Context, cmd *cli.Command) (context.Context, error) {
fmt.Fprintf(cmd.Root().Writer, "HEEEERE GOES\n")
return nil
return nil, nil
},
After: func(ctx context.Context, cmd *cli.Command) error {
fmt.Fprintf(cmd.Root().Writer, "Phew!\n")
Expand Down

0 comments on commit 68f9c2c

Please sign in to comment.