replace log.Fatal with cobra.CheckErr
This commit is contained in:
@@ -18,7 +18,6 @@ package cmd
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"log"
|
||||
"math/big"
|
||||
|
||||
"github.com/spf13/cobra"
|
||||
@@ -47,7 +46,7 @@ func gcd(cmd *cobra.Command, args []string) {
|
||||
for i, s := range args {
|
||||
_, ok := w.SetString(s, 10)
|
||||
if !ok {
|
||||
log.Fatal("invalid input " + s)
|
||||
cobra.CheckErr("invalid input " + s)
|
||||
}
|
||||
|
||||
z.GCD(x, y, z, w)
|
||||
|
||||
Reference in New Issue
Block a user