From f9c618ec4c2f80e0d3deb47be0c67724a73bdc14 Mon Sep 17 00:00:00 2001 From: rodion Date: Fri, 6 Sep 2024 00:08:35 +0000 Subject: [PATCH] Fix lint failures Signed-off-by: rodion --- cmd/config.go | 2 +- cmd/evmconnect.go | 2 +- cmd/version.go | 2 +- internal/ethereum/blocklistener.go | 6 +++--- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/cmd/config.go b/cmd/config.go index 02ca34d..1db10db 100644 --- a/cmd/config.go +++ b/cmd/config.go @@ -29,7 +29,7 @@ func configCommand() *cobra.Command { Use: "docs", Short: "Prints the config info as markdown", Long: "", - RunE: func(cmd *cobra.Command, args []string) error { + RunE: func(_ *cobra.Command, _ []string) error { InitConfig() b, err := config.GenerateConfigMarkdown(context.Background(), "", config.GetKnownKeys()) fmt.Println(string(b)) diff --git a/cmd/evmconnect.go b/cmd/evmconnect.go index 2f8dd4a..80ba7a4 100644 --- a/cmd/evmconnect.go +++ b/cmd/evmconnect.go @@ -41,7 +41,7 @@ var rootCmd = &cobra.Command{ Use: "evmconnect", Short: "Hyperledger FireFly Connector for EVM based blockchains", Long: ``, - RunE: func(cmd *cobra.Command, args []string) error { + RunE: func(_ *cobra.Command, _ []string) error { return run() }, } diff --git a/cmd/version.go b/cmd/version.go index 3ae8b8f..3d8f20d 100644 --- a/cmd/version.go +++ b/cmd/version.go @@ -53,7 +53,7 @@ func versionCommand() *cobra.Command { Use: "version", Short: "Prints the version info", Long: "", - RunE: func(cmd *cobra.Command, args []string) error { + RunE: func(_ *cobra.Command, _ []string) error { info := &Info{ Version: BuildVersionOverride, diff --git a/internal/ethereum/blocklistener.go b/internal/ethereum/blocklistener.go index 87199e6..7e9555f 100644 --- a/internal/ethereum/blocklistener.go +++ b/internal/ethereum/blocklistener.go @@ -128,7 +128,7 @@ func (bl *blockListener) newHeadsSubListener() { // getBlockHeightWithRetry keeps retrying attempting to get the initial block height until successful func (bl *blockListener) establishBlockHeightWithRetry() error { wsConnected := false - return bl.c.retry.Do(bl.ctx, "get initial block height", func(attempt int) (retry bool, err error) { + return bl.c.retry.Do(bl.ctx, "get initial block height", func(_ int) (retry bool, err error) { // If we have a WebSocket backend, then we connect it and switch over to using it // (we accept an un-locked update here to backend, as the most important routine that's @@ -404,7 +404,7 @@ func (bl *blockListener) rebuildCanonicalChain() *list.Element { for { var bi *blockInfoJSONRPC var reason ffcapi.ErrorReason - err := bl.c.retry.Do(bl.ctx, "rebuild listener canonical chain", func(attempt int) (retry bool, err error) { + err := bl.c.retry.Do(bl.ctx, "rebuild listener canonical chain", func(_ int) (retry bool, err error) { bi, reason, err = bl.getBlockInfoByNumber(bl.ctx, nextBlockNumber, false, "") return reason != ffcapi.ErrorReasonNotFound, err }) @@ -458,7 +458,7 @@ func (bl *blockListener) trimToLastValidBlock() (lastValidBlock *minimalBlockInf currentViewBlock := lastElem.Value.(*minimalBlockInfo) var freshBlockInfo *blockInfoJSONRPC var reason ffcapi.ErrorReason - err := bl.c.retry.Do(bl.ctx, "rebuild listener canonical chain", func(attempt int) (retry bool, err error) { + err := bl.c.retry.Do(bl.ctx, "rebuild listener canonical chain", func(_ int) (retry bool, err error) { freshBlockInfo, reason, err = bl.getBlockInfoByNumber(bl.ctx, currentViewBlock.number, false, "") return reason != ffcapi.ErrorReasonNotFound, err })