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"
|
||||
@@ -41,14 +40,14 @@ func convergents(cmd *cobra.Command, args []string) {
|
||||
|
||||
a0, ok := new(big.Int).SetString(args[0], 10)
|
||||
if !ok {
|
||||
log.Fatal("invalid input " + args[0])
|
||||
cobra.CheckErr("invalid input " + args[0])
|
||||
}
|
||||
|
||||
denoms := make([]big.Int, len(args[1:]))
|
||||
for i, d := range args[1:] {
|
||||
_, ok = denoms[i].SetString(d, 10)
|
||||
if !ok {
|
||||
log.Fatal("invalid input " + d)
|
||||
cobra.CheckErr("invalid input " + d)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user