mirror of
https://github.com/hanzoai/telemetry.git
synced 2026-10-30 20:01:49 +00:00
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.
22 lines
318 B
Go
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)
|
|
}
|
|
}
|