diff --git a/docs/v1/examples/generated-help-text.md b/docs/v1/examples/generated-help-text.md index 84ec272daf..db7c5724fc 100644 --- a/docs/v1/examples/generated-help-text.md +++ b/docs/v1/examples/generated-help-text.md @@ -63,7 +63,7 @@ VERSION: ` // EXAMPLE: Replace the `HelpPrinter` func - cli.HelpPrinter = func(w io.Writer, templ string, data interface{}) { + cli.HelpPrinter = func(w io.Writer, templ string, data any) { fmt.Println("Ha HA. I pwnd the help!!1") } @@ -103,4 +103,4 @@ func main() { log.Fatal(err) } } -``` +``` \ No newline at end of file diff --git a/docs/v1/examples/version-flag.md b/docs/v1/examples/version-flag.md index dc089a16ae..5ea5bd439d 100644 --- a/docs/v1/examples/version-flag.md +++ b/docs/v1/examples/version-flag.md @@ -110,7 +110,7 @@ func init() { cli.BashCompletionFlag = cli.BoolFlag{Name: "compgen", Hidden: true} cli.VersionFlag = cli.BoolFlag{Name: "print-version, V"} - cli.HelpPrinter = func(w io.Writer, templ string, data interface{}) { + cli.HelpPrinter = func(w io.Writer, templ string, data any) { fmt.Fprintf(w, "best of luck to you\n") } cli.VersionPrinter = func(c *cli.Context) { @@ -345,7 +345,7 @@ func main() { app.ErrWriter = &hexWriter{} } - app.Metadata = map[string]interface{}{ + app.Metadata = map[string]any{ "layers": "many", "explicable": false, "whatever-values": 19.99, @@ -360,4 +360,4 @@ func wopAction(c *cli.Context) error { fmt.Fprintf(c.App.Writer, ":wave: over here, eh\n") return nil } -``` +``` \ No newline at end of file diff --git a/docs/v2/examples/full-api-example.md b/docs/v2/examples/full-api-example.md index b1d8e2a555..ccbb45e5f0 100644 --- a/docs/v2/examples/full-api-example.md +++ b/docs/v2/examples/full-api-example.md @@ -34,7 +34,7 @@ func init() { cli.HelpFlag = &cli.BoolFlag{Name: "halp"} cli.VersionFlag = &cli.BoolFlag{Name: "print-version", Aliases: []string{"V"}} - cli.HelpPrinter = func(w io.Writer, templ string, data interface{}) { + cli.HelpPrinter = func(w io.Writer, templ string, data any) { fmt.Fprintf(w, "best of luck to you\n") } cli.VersionPrinter = func(cCtx *cli.Context) { @@ -242,7 +242,7 @@ func main() { fmt.Printf("made it!\n") return ec }, - Metadata: map[string]interface{}{ + Metadata: map[string]any{ "layers": "many", "explicable": false, "whatever-values": 19.99, @@ -261,4 +261,4 @@ func wopAction(cCtx *cli.Context) error { fmt.Fprintf(cCtx.App.Writer, ":wave: over here, eh\n") return nil } -``` +``` \ No newline at end of file diff --git a/docs/v2/examples/generated-help-text.md b/docs/v2/examples/generated-help-text.md index f733b96b50..a9f9e74c69 100644 --- a/docs/v2/examples/generated-help-text.md +++ b/docs/v2/examples/generated-help-text.md @@ -64,7 +64,7 @@ VERSION: ` // EXAMPLE: Replace the `HelpPrinter` func - cli.HelpPrinter = func(w io.Writer, templ string, data interface{}) { + cli.HelpPrinter = func(w io.Writer, templ string, data any) { fmt.Println("Ha HA. I pwnd the help!!1") } @@ -98,4 +98,4 @@ func main() { (&cli.App{}).Run(os.Args) } -``` +``` \ No newline at end of file diff --git a/docs/v3/examples/full-api-example.md b/docs/v3/examples/full-api-example.md index 610539b38e..6ec7a8fdd8 100644 --- a/docs/v3/examples/full-api-example.md +++ b/docs/v3/examples/full-api-example.md @@ -35,7 +35,7 @@ func init() { cli.HelpFlag = &cli.BoolFlag{Name: "halp"} cli.VersionFlag = &cli.BoolFlag{Name: "print-version", Aliases: []string{"V"}} - cli.HelpPrinter = func(w io.Writer, templ string, data interface{}) { + cli.HelpPrinter = func(w io.Writer, templ string, data any) { fmt.Fprintf(w, "best of luck to you\n") } cli.VersionPrinter = func(cmd *cli.Command) { @@ -216,7 +216,7 @@ func main() { fmt.Printf("made it!\n") return ec }, - Metadata: map[string]interface{}{ + Metadata: map[string]any{ "layers": "many", "explicable": false, "whatever-values": 19.99, @@ -235,4 +235,4 @@ func wopAction(ctx context.Context, cmd *cli.Command) error { fmt.Fprintf(cmd.Root().Writer, ":wave: over here, eh\n") return nil } -``` +``` \ No newline at end of file diff --git a/docs/v3/examples/help/generated-help-text.md b/docs/v3/examples/help/generated-help-text.md index 973a85756d..96be4a6435 100644 --- a/docs/v3/examples/help/generated-help-text.md +++ b/docs/v3/examples/help/generated-help-text.md @@ -64,7 +64,7 @@ VERSION: ` // EXAMPLE: Replace the `HelpPrinter` func - cli.HelpPrinter = func(w io.Writer, templ string, data interface{}) { + cli.HelpPrinter = func(w io.Writer, templ string, data any) { fmt.Println("Ha HA. I pwnd the help!!1") } @@ -99,4 +99,4 @@ func main() { (&cli.Command{}).Run(context.Background(), os.Args) } -``` +``` \ No newline at end of file diff --git a/help_test.go b/help_test.go index d3c831371d..f62bfb3ce6 100644 --- a/help_test.go +++ b/help_test.go @@ -520,7 +520,7 @@ func TestShowCommandHelp_HelpPrinter(t *testing.T) { /*{ name: "standard-command", template: "", - printer: func(w io.Writer, templ string, data interface{}) { + printer: func(w io.Writer, templ string, data any) { fmt.Fprint(w, "yo") }, command: "my-command", @@ -530,9 +530,9 @@ func TestShowCommandHelp_HelpPrinter(t *testing.T) { { name: "custom-template-command", template: "{{doublecho .Name}}", - printer: func(w io.Writer, templ string, data interface{}) { + printer: func(w io.Writer, templ string, data any) { // Pass a custom function to ensure it gets used - fm := map[string]interface{}{"doublecho": doublecho} + fm := map[string]any{"doublecho": doublecho} HelpPrinterCustom(w, templ, data, fm) }, command: "my-command", @@ -2143,4 +2143,4 @@ func TestCustomUsageCommandHelp(t *testing.T) { _ = cmd.Run(buildTestContext(t), []string{"app", "help"}) assert.Contains(t, out.String(), UsageCommandHelp) -} +} \ No newline at end of file