Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

go: Fix CLI tools to not print error messages twice #3230

Merged
merged 1 commit into from
Sep 3, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .changelog/3230.bugfix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
go: Fix CLI tools to not print error messages twice
3 changes: 2 additions & 1 deletion go/extra/stats/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package cmd

import (
"fmt"
"os"

"github.com/spf13/cobra"
flag "github.com/spf13/pflag"
Expand Down Expand Up @@ -38,7 +39,7 @@ func Execute() {
}

if err := rootCmd.Execute(); err != nil {
common.EarlyLogAndExit(err)
os.Exit(1)
}
}

Expand Down
2 changes: 1 addition & 1 deletion go/oasis-net-runner/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ func RootCmd() *cobra.Command {
// Execute spawns the main entry point after handing the config file.
func Execute() {
if err := rootCmd.Execute(); err != nil {
common.EarlyLogAndExit(err)
os.Exit(1)
}
}

Expand Down
3 changes: 2 additions & 1 deletion go/oasis-node/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
package cmd

import (
"os"
"syscall"

"github.com/spf13/cobra"
Expand Down Expand Up @@ -41,7 +42,7 @@ func Execute() {
syscall.Umask(0o077)

if err := rootCmd.Execute(); err != nil {
cmdCommon.EarlyLogAndExit(err)
os.Exit(1)
}
}

Expand Down
2 changes: 1 addition & 1 deletion go/oasis-remote-signer/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ var (
// Execute spawns the main entry point after handling the config file.
func Execute() {
if err := rootCmd.Execute(); err != nil {
cmdCommon.EarlyLogAndExit(err)
os.Exit(1)
}
}

Expand Down