From a3d78e4272045cbc68bed6919d5d21cf50bdea03 Mon Sep 17 00:00:00 2001 From: Danimar Ribeiro Date: Mon, 12 Dec 2022 14:36:26 -0300 Subject: [PATCH] Creates a new flagset to avoid conflit with other libraries that use the same flag (#213) https://github.com/DataDog/dd-trace-go/issues/1153 --- baker_cli.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/baker_cli.go b/baker_cli.go index 01c9263a..336732c1 100644 --- a/baker_cli.go +++ b/baker_cli.go @@ -30,6 +30,8 @@ func MainCLI(components Components) error { log.SetFormatter(&log.JSONFormatter{}) log.SetOutput(os.Stderr) + // Create a new flagset to avoid conflict with other libraries + flag.CommandLine = flag.NewFlagSet(os.Args[0], flag.ExitOnError) var ( flagHelpConfig = flag.String("help", "", "show help for a `component` (input/filter/output/upload) (use '*' to dump all)") flagVerbose = flag.Bool("v", false, "verbose logging (debug level)")