cli-plugins: helloworld: rename var that collided with import

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn 2024-01-11 22:25:15 +01:00
parent c825db8a69
commit c0a0b05dc8
No known key found for this signature in database
GPG Key ID: 76698F39D527CE8C
1 changed files with 4 additions and 4 deletions

View File

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