From 8ae66d6c6a2aa27105566bbdf41dd569b2e4a109 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Magiera?= Date: Sat, 10 Oct 2020 14:06:03 +0200 Subject: [PATCH] Fix lint warnings Signed-off-by: Jakub Sztandera --- chain/wallet/ledger/ledger.go | 12 +++++++----- cmd/lotus-shed/ledger.go | 14 +++----------- 2 files changed, 10 insertions(+), 16 deletions(-) diff --git a/chain/wallet/ledger/ledger.go b/chain/wallet/ledger/ledger.go index 71ec067c8..94a828603 100644 --- a/chain/wallet/ledger/ledger.go +++ b/chain/wallet/ledger/ledger.go @@ -5,16 +5,18 @@ import ( "context" "encoding/json" "fmt" + "github.com/ipfs/go-cid" + "github.com/ipfs/go-datastore" + "github.com/ipfs/go-datastore/query" + ledgerfil "github.com/whyrusleeping/ledger-filecoin-go" "golang.org/x/xerrors" "github.com/filecoin-project/go-address" "github.com/filecoin-project/go-state-types/crypto" + "github.com/filecoin-project/lotus/api" "github.com/filecoin-project/lotus/chain/types" - "github.com/ipfs/go-datastore" - "github.com/ipfs/go-datastore/query" - ledgerfil "github.com/whyrusleeping/ledger-filecoin-go" ) type LedgerWallet struct { @@ -42,7 +44,7 @@ func (lw LedgerWallet) WalletSign(ctx context.Context, signer address.Address, t if err != nil { return nil, err } - defer fl.Close() + defer fl.Close() // nolint:errcheck if meta.Type != api.MTChainMsg { return nil, fmt.Errorf("ledger can only sign chain messages") } @@ -82,7 +84,7 @@ func (lw LedgerWallet) getKeyInfo(addr address.Address) (*LedgerKeyInfo, error) var out LedgerKeyInfo if err := json.Unmarshal(kib, &out); err != nil { - return nil, err + return nil, xerrors.Errorf("unmarshalling ledger key info: %w", err) } return &out, nil diff --git a/cmd/lotus-shed/ledger.go b/cmd/lotus-shed/ledger.go index fd7ac1b51..8111cc6bf 100644 --- a/cmd/lotus-shed/ledger.go +++ b/cmd/lotus-shed/ledger.go @@ -33,8 +33,8 @@ var ledgerListAddressesCmd = &cli.Command{ Name: "list", Flags: []cli.Flag{ &cli.BoolFlag{ - Name: "print-balances", - Usage: "print balances", + Name: "print-balances", + Usage: "print balances", Aliases: []string{"b"}, }, }, @@ -137,19 +137,11 @@ func printHDPath(pth []uint32) string { return strings.TrimRight(s, "/") } -func numlist(p []uint32) string { - var out []string - for _, v := range p { - out = append(out, fmt.Sprint(v)) - } - return strings.Join(out, ",") -} - var ledgerKeyInfoCmd = &cli.Command{ Name: "key-info", Flags: []cli.Flag{ &cli.BoolFlag{ - Name: "verbose", + Name: "verbose", Aliases: []string{"v"}, }, },