From c0a0b05dc88dc350c8290ea27e911481b1900cac Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Thu, 11 Jan 2024 22:25:15 +0100 Subject: [PATCH] cli-plugins: helloworld: rename var that collided with import Signed-off-by: Sebastiaan van Stijn --- cli-plugins/examples/helloworld/main.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cli-plugins/examples/helloworld/main.go b/cli-plugins/examples/helloworld/main.go index ba23f4954e..0461e01c8c 100644 --- a/cli-plugins/examples/helloworld/main.go +++ b/cli-plugins/examples/helloworld/main.go @@ -45,8 +45,8 @@ func main() { } var ( - who, context string - preRun, debug bool + who, optContext string + preRun, debug bool ) cmd := &cobra.Command{ Use: "helloworld", @@ -65,7 +65,7 @@ func main() { fmt.Fprintf(dockerCli.Err(), "Plugin debug mode enabled") } - switch context { + switch optContext { case "Christmas": fmt.Fprintf(dockerCli.Out(), "Merry Christmas!\n") return nil @@ -92,7 +92,7 @@ func main() { // These are intended to deliberately clash with the CLIs own top // level arguments. flags.BoolVarP(&debug, "debug", "D", false, "Enable debug") - flags.StringVarP(&context, "context", "c", "", "Is it Christmas?") + flags.StringVarP(&optContext, "context", "c", "", "Is it Christmas?") cmd.AddCommand(goodbye, apiversion, exitStatus2) return cmd