Files
telemetry/cmd/builder/main.go
dsevrandGitHub cf63474526 Avoid duplicate Cobra CLI error output in generated commands (#14436)
Cobra already prints the user-facing error and usage on Execute()
failure.
Using cobra.CheckErr(cmd.Execute()) causes duplicate error output.

This change aligns cmd/builder and cmd/mdatagen with the previously
accepted pattern (PR #14317): let Cobra own CLI messaging and have
main() only control the exit code.
2026-02-23 09:40:54 +00:00

22 lines
318 B
Go

// Copyright The OpenTelemetry Authors
// SPDX-License-Identifier: Apache-2.0
package main
import (
"os"
"github.com/spf13/cobra"
"go.opentelemetry.io/collector/cmd/builder/internal"
)
func main() {
cmd, err := internal.Command()
cobra.CheckErr(err)
if err := cmd.Execute(); err != nil {
os.Exit(1)
}
}