From 9d9a3142ad4521e545f5043c7b1f22d3ce767cc8 Mon Sep 17 00:00:00 2001 From: Phi Date: Mon, 27 May 2024 15:08:48 +0200 Subject: [PATCH] fix: handle unchecked error return values fix: handle unchecked error return values --- cli/multisig.go | 13 +++++++++---- cli/paych.go | 8 ++++++-- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/cli/multisig.go b/cli/multisig.go index ecf45224b2b..3df47ea1811 100644 --- a/cli/multisig.go +++ b/cli/multisig.go @@ -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 @@ -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() diff --git a/cli/paych.go b/cli/paych.go index 6a073b4ef05..87dfe9a19d7 100644 --- a/cli/paych.go +++ b/cli/paych.go @@ -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 }, @@ -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 }, }