Skip to content

Commit

Permalink
fix: handle unchecked error return values
Browse files Browse the repository at this point in the history
fix: handle unchecked error return values
  • Loading branch information
rjan90 committed May 27, 2024
1 parent 4b484ee commit 9d9a314
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 6 deletions.
13 changes: 9 additions & 4 deletions cli/multisig.go
Original file line number Diff line number Diff line change
Expand Up @@ -168,8 +168,9 @@ var msigCreateCmd = &cli.Command{

// check it executed successfully
if wait.Receipt.ExitCode.IsError() {
fmt.Fprintln(cctx.App.Writer, "actor creation failed!")
return err
if _, err := fmt.Fprintln(cctx.App.Writer, "actor creation failed!"); err != nil {
return err
}
}

// get address of newly created miner
Expand Down Expand Up @@ -243,8 +244,12 @@ var msigInspectCmd = &cli.Command{
return err
}

fmt.Fprintf(cctx.App.Writer, "Balance: %s\n", types.FIL(act.Balance))
fmt.Fprintf(cctx.App.Writer, "Spendable: %s\n", types.FIL(types.BigSub(act.Balance, locked)))
if _, err := fmt.Fprintf(cctx.App.Writer, "Balance: %s\n", types.FIL(act.Balance)); err != nil {
return err
}
if _, err := fmt.Fprintf(cctx.App.Writer, "Spendable: %s\n", types.FIL(types.BigSub(act.Balance, locked))); err != nil {
return err
}

if cctx.Bool("vesting") {
ib, err := mstate.InitialBalance()
Expand Down
8 changes: 6 additions & 2 deletions cli/paych.go
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,9 @@ var paychListCmd = &cli.Command{
}

for _, v := range chs {
fmt.Fprintln(cctx.App.Writer, v.String())
if _, err := fmt.Fprintln(cctx.App.Writer, v.String()); err != nil {
return err
}
}
return nil
},
Expand Down Expand Up @@ -400,7 +402,9 @@ var paychVoucherCreateCmd = &cli.Command{
return err
}

fmt.Fprintln(cctx.App.Writer, enc)
if _, err := fmt.Fprintln(cctx.App.Writer, enc); err != nil {
return err
}
return nil
},
}
Expand Down

0 comments on commit 9d9a314

Please sign in to comment.